-
-
Notifications
You must be signed in to change notification settings - Fork 45
Fixed logic around receiving and storing Connect DB passphrases. #3033
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
Conversation
Added analytics event when database is rekeyed with new passphrase.
📝 WalkthroughWalkthroughThe changes introduce conditional logic to the database rekeying process in A new analytics event constant, Sequence Diagram(s)sequenceDiagram
participant Remote as Remote Source
participant ConnectDatabaseHelper
participant Database
participant FirebaseAnalyticsUtil
Remote->>ConnectDatabaseHelper: handleReceivedDbPassphrase(remotePassphrase)
alt Database is open AND remotePassphrase != localPassphrase
ConnectDatabaseHelper->>Database: Rekey with remotePassphrase
ConnectDatabaseHelper->>FirebaseAnalyticsUtil: reportRekeyedDatabase()
ConnectDatabaseHelper->>ConnectDatabaseHelper: Store remotePassphrase as local
else Database not open or passphrase unchanged
ConnectDatabaseHelper-->>Remote: No action
end
Suggested reviewers
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (1)app/src/org/commcare/google/services/analytics/FirebaseAnalyticsUtil.java (1)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@damagatchi retest this please |
https://dimagi.atlassian.net/browse/CCCT-950
cross-request: dimagi/commcare-core#1455
Product Description
Fixes a bug where the app would sometimes crash during registration.
Technical Summary
Fixed handling for received remote passphrase to properly rekey when necessary, and then store the local passphrase.
Added analytics event when database is rekeyed with new passphrase.
More notes about the crash that caused this here
Feature Flag
ConnectID
Safety Assurance
Safety story
Tested several scenarios locally.
QA plan should make sure to include the testing described below.
Automated test coverage
None
QA Plan
Tests that need to be performed around this, all should not crash: