-
-
Notifications
You must be signed in to change notification settings - Fork 45
Auto login fix for Connect apps #3259
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
Passing IS_LAUNCH_FROM_CONNECT flag between intents in DispatchActivity.
|
Caution Review failedFailed to post review comments. 📝 WalkthroughWalkthroughThis change introduces a comprehensive new feature set for CommCare Connect, including messaging, job management, and delivery/payment progress tracking. It adds two new activities ( Sequence Diagram(s)Connect Messaging Notification FlowsequenceDiagram
participant FCM as Firebase Cloud Messaging
participant Service as CommCareFirebaseMessagingService
participant Util as FirebaseMessagingUtil
participant Activity as ConnectMessagingActivity
participant DB as ConnectMessagingDatabaseHelper
FCM->>Service: Receives FCM message
Service->>Util: handleNotification(context, data, notification)
Util->>Activity: Launch ConnectMessagingActivity (if CCC_MESSAGE action)
Activity->>DB: Validate channelId from intent
DB-->>Activity: Channel exists?
alt Channel exists
Activity->>Activity: Check consent and encryption key
alt Consent and key present
Activity->>Activity: Navigate to message fragment
else Consent/key missing
Activity->>Activity: Navigate to consent or fetch key
end
else Channel missing
Activity->>Util: Retrieve messages from server
Util->>DB: Store channels/messages
Activity->>Activity: Retry channel validation
end
Connect Job Claim and Delivery ProgresssequenceDiagram
participant User as User
participant DeliveryDetails as ConnectDeliveryDetailsFragment
participant API as ApiConnect
participant JobHelper as ConnectJobHelper
participant DB as ConnectJobUtils
participant Activity as ConnectActivity
User->>DeliveryDetails: Clicks "Claim Job" button
DeliveryDetails->>API: claimJob(userId, jobId)
API-->>DeliveryDetails: Success/failure response
alt Success
DeliveryDetails->>JobHelper: Update job status to "delivering"
JobHelper->>DB: Store updated job
DeliveryDetails->>Activity: Close user session
DeliveryDetails->>Activity: Navigate to delivery progress or downloading
else Failure
DeliveryDetails->>DeliveryDetails: Show error message
end
Messaging Send/Receive FlowsequenceDiagram
participant User as User
participant MessageFragment as ConnectMessageFragment
participant MessageManager as MessageManager
participant DB as ConnectMessagingDatabaseHelper
participant API as ApiPersonalId
User->>MessageFragment: Types and sends message
MessageFragment->>DB: Store outgoing message locally
MessageFragment->>MessageManager: sendMessage(context, message, listener)
MessageManager->>API: sendMessagingMessage(username, password, message, key)
API-->>MessageManager: Success/failure callback
alt Success
MessageManager->>DB: Mark message as confirmed
MessageManager->>MessageFragment: Notify success
else Failure
MessageManager->>MessageFragment: Notify failure
end
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
The base branch was changed.
Product Description
Fixes a recent breaking change to auto-login code
Technical Summary
We pass a flag back to Dispatch when launching a Connect app indicating that the app was launched from Connect.
Dispatch then launches the LoginActivity, which should auto-login.
But Dispatch wasn't passing the IS_LAUNCH_FROM_CONNECT flag through from one intent to the other.
Feature Flag
Connect
Safety Assurance
Safety story
Tested manually to verify that auto-login works again