Skip to content

Conversation

@OrangeAndGreen
Copy link
Contributor

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

Passing IS_LAUNCH_FROM_CONNECT flag between intents in DispatchActivity.
@OrangeAndGreen OrangeAndGreen changed the base branch from master to feature/connect July 18, 2025 17:58
@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

Caution

Review failed

Failed to post review comments.

📝 Walkthrough

Walkthrough

This change introduces a comprehensive new feature set for CommCare Connect, including messaging, job management, and delivery/payment progress tracking. It adds two new activities (ConnectActivity, ConnectMessagingActivity), multiple new fragments for job lists, job details, messaging, delivery progress, and payment confirmation, as well as supporting adapters, models, and database helpers. Notification handling is significantly expanded to support actionable push notifications for messaging and payments. The codebase is refactored to delegate navigation and job management logic to new helper classes, and PersonalIdManager is simplified. Numerous layout files are updated for data binding, and new string resources are added across multiple languages. The AndroidManifest and Proguard configurations are updated accordingly.

Sequence Diagram(s)

Connect Messaging Notification Flow

sequenceDiagram
    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
Loading

Connect Job Claim and Delivery Progress

sequenceDiagram
    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
Loading

Messaging Send/Receive Flow

sequenceDiagram
    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
Loading

Possibly related PRs

Suggested labels

skip-integration-tests

Suggested reviewers

  • pm-dimagi
  • shubham1g5
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dv/auto_login_fix

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Jignesh-dimagi
Jignesh-dimagi previously approved these changes Jul 21, 2025
@OrangeAndGreen OrangeAndGreen changed the base branch from feature/connect to Beta_2.58_474459 July 21, 2025 11:57
pm-dimagi
pm-dimagi previously approved these changes Jul 21, 2025
@OrangeAndGreen OrangeAndGreen changed the base branch from Beta_2.58_474459 to feature/connect July 21, 2025 12:05
@OrangeAndGreen OrangeAndGreen dismissed stale reviews from pm-dimagi and Jignesh-dimagi July 21, 2025 12:05

The base branch was changed.

@OrangeAndGreen OrangeAndGreen merged commit 1da6be1 into feature/connect Jul 24, 2025
1 of 2 checks passed
@OrangeAndGreen OrangeAndGreen deleted the dv/auto_login_fix branch July 24, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants