HomePhabricator
Diffusion Comm 30a703aec0fd

Implement unencrypted log capture without attachments

Description

Implement unencrypted log capture without attachments

Summary:
This differential implements API that enables to monitor and capture backup logs. At this point logs are unencrypted, without attachments. Future differentials will improve those deficiencies. This diff doesn't break the app since log capture is not actually called yet.

How does log capture work?

  1. We attach session to database connection and session starts to accumulate logs.
  2. Each time we call captureLogs we read logID from metadata table in database, store log to file identified by this logID and finally write incremented logID to the database.

Test Plan:

  1. Add a call to DatabaseManager::getQueryExecutor().captureBackupLogs() just before DatabaseManager::getQueryExecutor().commitTransaction() in BaseDataStore.h.
  2. Use the app: make drafts, send messages, update threads colours etc..
  3. Periodically download app container from XCode.
  4. Ensure that there are created backup-0-log-xxx files that contain unreadable bytes mixed with readable strings with database table names and database entities fields values.

Reviewers: michal, kamil

Reviewed By: michal

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D10835

Details

Provenance
marcinAuthored on Jan 25 2024, 9:29 AM
Reviewer
michal
Differential Revision
D10835: Implement unencrypted log capture without attachments
Parents
rCOMM68d3b4ee8b60: Bump SQLCipher Amalgamation version to enable sqlite3 session extension
Branches
Unknown
Tags
Unknown