-
Notifications
You must be signed in to change notification settings - Fork 12
[WIP] Remove database usage from push notification extension #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mpretty-cyro
wants to merge
14
commits into
dev
Choose a base branch
from
feature/database-relocation
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
• Updated the General cache to include the users seckey (rather than fetching it from the DB every time causing unneeded load) • Updated a bunch of Crypto usage to no longer need a `db` or `dependencies` instance passed to it • Added unit tests for General.Cache • Replaced `Identity.userExists` with `General.Cache.userExists` (no need for database access anymore) • Moved the SwarmPoller message handling logic into it's own function to make debugging stack traces a little easier • Cleaned up some hard-to-read logic
DBR - 1 - Cached seckey, cleaned up crypto usage
• Added the new MessageDeduplication table • Added a migration to populate the MessageDeduplication table • Added ExtensionHelper functions to store records in the AppGroup for deduplication purposes • Updated the logic to use MessageDeduplication table & files for deduplication purposes • Refactored message parsing to not rely on the database • Refactored message deduplication to not rely on the database in the PN extension • Removed the old ControlMessageProcessRecord table
…receiving-process DBR - 2 - Refactored the message deduplication logic
• Updated the General cache to include the users seckey (rather than fetching it from the DB every time causing unneeded load) • Updated a bunch of Crypto usage to no longer need a `db` or `dependencies` instance passed to it • Added unit tests for General.Cache • Replaced `Identity.userExists` with `General.Cache.userExists` (no need for database access anymore) • Moved the SwarmPoller message handling logic into it's own function to make debugging stack traces a little easier • Cleaned up some hard-to-read logic
…message-notification DBR - 3 - Initial notification extension refactoring, handling visible message PNs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The iOS app has had a long standing crash related to the database, the app crashes with the error code
0xdead10cc
(or “Deadlock”) and it happens when the app goes into a “suspended” state whilst it still maintains a lock on the database. We've tried a number of times to resolve this issue without a large structural change but, while we seem to have reduced the frequency, we've been unable to entirely resolve it.Since we have exhausted all other options the goal now is to move the database file (and any other app data) from the “AppGroup” into the main app directory where the OS will no longer need to put a lock on the file, and as a result the
0xdead10cc
should no longer be possible.The purpose of this PR is to update the Push Notification Extension to function without needing access to the database (the first step needed to relocate the app files).