Skip to content

Conversation

@pm-dimagi
Copy link
Contributor

Product Description

Renamed every connectid to personal id
try to cover all the name changes

Technical Summary

Feature Flag

Safety Assurance

Safety story

Automated test coverage

QA Plan

Labels and Review

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@pm-dimagi pm-dimagi requested a review from shubham1g5 May 17, 2025 07:17
@coderabbitai
Copy link

coderabbitai bot commented May 17, 2025

📝 Walkthrough

Walkthrough

This change performs a comprehensive renaming and refactoring of the "ConnectID" feature to "PersonalID" throughout the codebase. It updates class names, method names, constants, resource strings, package names, and XML references from "ConnectID" or "connectId" to "PersonalID" or "personalId". Several classes, such as ConnectIDManager and ApiConnectId, are renamed to PersonalIdManager and ApiPersonalId, respectively. Related methods and constants are similarly renamed. Some obsolete methods and constants related to secondary phone and password management are removed. No significant changes to the underlying logic or control flow are introduced; the focus is on terminology and structural consistency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Activity
    participant PersonalIdManager
    participant ApiPersonalId
    participant Database

    User->>Activity: Initiates PersonalID action (register, login, etc.)
    Activity->>PersonalIdManager: Calls relevant PersonalIdManager method
    PersonalIdManager->>ApiPersonalId: Makes API request (registration, verification, etc.)
    ApiPersonalId-->>PersonalIdManager: Returns API response
    PersonalIdManager->>Database: Updates user/app linking or registration phase
    PersonalIdManager-->>Activity: Returns result/status
    Activity-->>User: Updates UI or navigates based on result
Loading

Possibly related PRs

  • dimagi/commcare-android#3094: Modifies the ConnectIdActivity to make a navigation dialog non-cancellable; directly related as this PR renames and refactors ConnectIdActivity.
  • dimagi/commcare-android#3110: Performs extensive renaming and refactoring from "ConnectID" to "PersonalID" across multiple files, indicating a directly related renaming effort.
  • dimagi/commcare-android#3029: Modifies the checkConnectIdLink method and related linking logic in ConnectIDManager, which is replaced and refactored in this PR.

Suggested labels

skip-integration-tests

Suggested reviewers

  • shubham1g5
  • OrangeAndGreen

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch pm_1240
  • Post Copyable Unit Tests in Comment

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 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

🔭 Outside diff range comments (13)
app/res/values/strings.xml (1)

333-333: ⚠️ Potential issue

Missed renamed reference in error message

This error message still refers to "ConnectID" instead of "PersonalID".

-    <string name="recovery_network_token_request_rejected" cc:translatable="true">Lost ConnectID configuration with server, please recover account.</string>
+    <string name="recovery_network_token_request_rejected" cc:translatable="true">Lost PersonalID configuration with server, please recover account.</string>
app/src/org/commcare/activities/connect/PersonalIdActivity.java (5)

67-67: ⚠️ Potential issue

Fragment ID reference not updated

There's still a reference to nav_host_fragment_connectid which should be updated to nav_host_fragment_personalid for consistency.

-                (NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_connectid);
+                (NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_personalid);

77-79: ⚠️ Potential issue

Another fragment ID reference not updated

Similar to the previous issue, there's another reference to nav_host_fragment_connectid that needs to be updated.

-                (NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_connectid);
+                (NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_personalid);

31-31: ⚠️ Potential issue

Layout reference not updated

The activity layout reference activity_connect_id should be updated to activity_personal_id for consistency.

-        setContentView(R.layout.activity_connect_id);
+        setContentView(R.layout.activity_personal_id);

45-47: ⚠️ Potential issue

Incomplete constant renaming

While most constants are updated, ConnectConstants.CONNECT_JOB_INFO is still using the old prefix and should be updated to ConnectConstants.PERSONALID_JOB_INFO.

-        } else if (requestCode == ConnectConstants.CONNECT_JOB_INFO) {
+        } else if (requestCode == ConnectConstants.PERSONALID_JOB_INFO) {

54-56: ⚠️ Potential issue

Additional constant needs updating

The constant ConnectConstants.BEGIN_REGISTRATION should also be updated to ConnectConstants.PERSONALID_BEGIN_REGISTRATION for consistency.

-        if (value != null && value == ConnectConstants.BEGIN_REGISTRATION) {
+        if (value != null && value == ConnectConstants.PERSONALID_BEGIN_REGISTRATION) {
app/src/org/commcare/android/database/connect/models/ConnectLinkedAppRecord.java (2)

138-143: ⚠️ Potential issue

Inconsistency between method name and field operations

The method severPersonalIdLink has been renamed but still clears the connectIdLinked field.

Update the field reference:

public void severPersonalIdLink() {
-    connectIdLinked = false;
+    personalIdLinked = false;
    password = "";
    linkOffered1 = false;
    linkOffered2 = false;
}

188-188: ⚠️ Potential issue

Instance of inconsistent field naming in migration method

The fromV9 method still references getConnectIdLinked() in the older record model and assigns to connectIdLinked in the new model.

This code needs to be updated to work with the new method names:

-newRecord.connectIdLinked = oldRecord.getConnectIdLinked();
+newRecord.connectIdLinked = oldRecord.getPersonalIdLinked();

Or if you're renaming the field as suggested:

-newRecord.connectIdLinked = oldRecord.getConnectIdLinked();
+newRecord.personalIdLinked = oldRecord.getPersonalIdLinked();
app/src/org/commcare/connect/network/connectId/ApiService.java (1)

1-1: ⚠️ Potential issue

Package name inconsistency with new naming convention

The file is still in the connectId package despite the renaming of "connectid" to "personalid" throughout the codebase.

The package should be renamed to personalId for consistency:

-package org.commcare.connect.network.connectId;
+package org.commcare.connect.network.personalId;

This will require updating all imports that reference this package across the codebase.

app/src/org/commcare/connect/network/ApiPersonalId.java (3)

50-50: ⚠️ Potential issue

Inconsistent constant naming

The constant CONNECT_CLIENT_ID still uses the old naming convention.

Rename this constant to align with the new naming convention:

-private static final String CONNECT_CLIENT_ID = "zqFUtAAMrxmjnC1Ji74KAa6ZpY1mZly0J0PlalIa";
+private static final String PERSONAL_ID_CLIENT_ID = "zqFUtAAMrxmjnC1Ji74KAa6ZpY1mZly0J0PlalIa";

97-127: ⚠️ Potential issue

Method name and string references need updating

The method retrieveConnectIdTokenSync and references to ConnectTokenURL and ConnectConstants.CONNECT_KEY_TOKEN still use the old naming convention.

Update method name and references to match the new naming standard:

-public static AuthInfo.TokenAuth retrieveConnectIdTokenSync(Context context, @NonNull ConnectUserRecord user)
+public static AuthInfo.TokenAuth retrievePersonalIdTokenSync(Context context, @NonNull ConnectUserRecord user)

And update the resource string references and constants as needed.


67-246: 🛠️ Refactor suggestion

Security issue with API call implementation

In the callApi method, progress dialogs are shown/dismissed on the UI thread, but there's no timeout mechanism for API calls, which could lead to unresponsive UI if the network request hangs.

Consider adding a timeout to the API calls or implementing a timeout handler:

// Example implementation
private static final int API_TIMEOUT_MS = 30000; // 30 seconds

static void callApi(Context context, Call<ResponseBody> call, IApiCallback callback) {
    showProgressDialog(context);
    
    // Add timeout handler
    Handler timeoutHandler = new Handler(Looper.getMainLooper());
    Runnable timeoutRunnable = () -> {
        call.cancel();
        dismissProgressDialog(context);
        callback.processNetworkFailure();
    };
    timeoutHandler.postDelayed(timeoutRunnable, API_TIMEOUT_MS);
    
    call.enqueue(new Callback<ResponseBody>() {
        @Override
        public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) {
            timeoutHandler.removeCallbacks(timeoutRunnable); // Remove timeout handler
            dismissProgressDialog(context);
            // rest of implementation...
        }
        
        @Override
        public void onFailure(Call<ResponseBody> call, Throwable t) {
            timeoutHandler.removeCallbacks(timeoutRunnable); // Remove timeout handler
            dismissProgressDialog(context);
            // rest of implementation...
        }
    });
}
app/src/org/commcare/connect/PersonalIdManager.java (1)

335-336: 💡 Verification agent

🧩 Analysis chain

Update string resource references to match PersonalID terminology.

The string resource references in the dialog should be updated to match the PersonalID terminology.


🏁 Script executed:

#!/bin/bash
# Check if the string resources have been updated to use PersonalID terminology
rg -i "connectid" app/res/values/strings.xml

Length of output: 1785


Update string resources to use “PersonalID” terminology

The following entries in app/res/values/strings.xml still reference “ConnectID” and need to be renamed and updated in both name and text to use “PersonalID”:

• recovery_network_token_request_rejected
• connect_recovery_success_message
• login_button_connectid
• login_link_connectid_title
• login_link_connectid_message
• login_unlink_connectid_title
• login_unlink_connectid_message
• login_link_connectid_yes
• login_link_connectid_no
• (and any other ConnectID-related keys or URLs)

Please rename these keys (e.g. login_link_connectid_titlelogin_link_personalid_title) and update their values accordingly.

🧹 Nitpick comments (15)
app/src/org/commcare/connect/workers/ConnectHeartbeatWorker.kt (1)

12-13: Consider renaming the worker class for consistency.

While all references to ConnectID have been renamed to PersonalID, the worker class itself is still named ConnectHeartbeatWorker. Consider renaming it to PersonalIdHeartbeatWorker for complete consistency.

app/src/org/commcare/connect/database/ConnectAppDatabaseUtil.java (1)

34-35: Inconsistent parameter and documentation naming

While the method has been renamed from setConnectIdLinked to setPersonalIdLinked, the parameter name connectIdLinked and the Javadoc comment at line 34 still use the old "ConnectID" terminology.

/**
 * Stores or updates a ConnectLinkedAppRecord in the database.
 *
 * @param context         The Android context
 * @param appId           Application identifier
 * @param userId          User identifier
- * @param connectIdLinked Whether the app is linked to ConnectID
+ * @param connectIdLinked Whether the app is linked to PersonalID
 * @param passwordOrPin   User's password or PIN
 * @param workerLinked    Whether the app is linked to a worker
 * @param localPassphrase Whether using local passphrase
 * @return The stored record
 * throw error if storage operations fail
 */
public static ConnectLinkedAppRecord storeApp(Context context, String appId, String userId, boolean connectIdLinked, String passwordOrPin, boolean workerLinked, boolean localPassphrase) {

    // Later in the method:
    record.setPersonalIdLinked(connectIdLinked);

Consider updating the parameter name and documentation for consistency:

/**
 * Stores or updates a ConnectLinkedAppRecord in the database.
 *
 * @param context          The Android context
 * @param appId            Application identifier
 * @param userId           User identifier
- * @param connectIdLinked  Whether the app is linked to ConnectID
+ * @param personalIdLinked Whether the app is linked to PersonalID
 * @param passwordOrPin    User's password or PIN
 * @param workerLinked     Whether the app is linked to a worker
 * @param localPassphrase  Whether using local passphrase
 * @return The stored record
 * throw error if storage operations fail
 */
-public static ConnectLinkedAppRecord storeApp(Context context, String appId, String userId, boolean connectIdLinked, String passwordOrPin, boolean workerLinked, boolean localPassphrase) {
+public static ConnectLinkedAppRecord storeApp(Context context, String appId, String userId, boolean personalIdLinked, String passwordOrPin, boolean workerLinked, boolean localPassphrase) {

    // Later in the method:
-    record.setPersonalIdLinked(connectIdLinked);
+    record.setPersonalIdLinked(personalIdLinked);

Also applies to: 41-41, 50-50

app/src/org/commcare/connect/network/ConnectSsoHelper.java (1)

1-1: File and class names not updated to follow PersonalId convention

While the internal code has been updated to use the PersonalId naming, the file name (ConnectSsoHelper.java) and class name (ConnectSsoHelper) still use the "Connect" prefix rather than "Personal". This creates an inconsistency in the codebase.

Additionally, the class Javadoc still references "ConnectID" in the description.

Consider either:

  1. Renaming this file and class to PersonalIdSsoHelper for full consistency, or
  2. Updating the class Javadoc to reflect that this handles "PersonalID" instead of "ConnectID" if "Connect" is intentionally being kept as a broader concept.
/**
- * Helper class for making SSO calls (both to ConnectID and HQ servers)
+ * Helper class for making SSO calls (both to PersonalID and HQ servers)
 *
 * @author dviggiano
 */

Also applies to: 25-25

app/src/org/commcare/activities/DispatchActivity.java (1)

68-69: Inconsistent variable naming

While the intent extra key has been renamed from CONNECTID_MANAGED_LOGIN to PERSONALID_MANAGED_LOGIN, the corresponding local variable connectIdManagedLogin has not been renamed to follow the same convention.

Additionally, the related variable connectManagedLogin and its usages have not been renamed, which could lead to confusion about the distinction between these two similar variables.

- private boolean connectIdManagedLogin;
+ private boolean personalIdManagedLogin;
  private boolean connectManagedLogin;

  // Later in the code:
- connectIdManagedLogin = intent.getBooleanExtra(LoginActivity.PERSONALID_MANAGED_LOGIN, false);
+ personalIdManagedLogin = intent.getBooleanExtra(LoginActivity.PERSONALID_MANAGED_LOGIN, false);

Also applies to: 473-474

app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java (3)

47-48: Button IDs not updated in click listeners

The button IDs connectMessageButton and connectMessageButton2 should be updated to personalIdMessageButton and personalIdMessageButton2 for consistency.

-        binding.connectMessageButton.setOnClickListener(v -> handleContinueButtonPress());
-        binding.connectMessageButton2.setOnClickListener(v -> handleContinueButtonPress());
+        binding.personalIdMessageButton.setOnClickListener(v -> handleContinueButtonPress());
+        binding.personalIdMessageButton2.setOnClickListener(v -> handleContinueButtonPress());

57-59: Text view IDs not updated

The text view IDs connectMessageTitle and connectMessageMessage should be updated to personalIdMessageTitle and personalIdMessageMessage for consistency.

-        binding.connectMessageTitle.setText(title);
-        binding.connectMessageMessage.setText(message);
+        binding.personalIdMessageTitle.setText(title);
+        binding.personalIdMessageMessage.setText(message);

105-108: Button ID not updated in visibility toggle

The button ID connectMessageButton2 should be updated to personalIdMessageButton2 for consistency.

-        binding.connectMessageButton2.setVisibility(show ? View.VISIBLE : View.GONE);
+        binding.personalIdMessageButton2.setVisibility(show ? View.VISIBLE : View.GONE);
-            binding.connectMessageButton2.setText(buttonText);
+            binding.personalIdMessageButton2.setText(buttonText);
app/src/org/commcare/connect/network/connectId/ApiService.java (1)

9-52: Missing method documentation

While several method signatures have been reformatted and some methods have been removed, there's no documentation for any of the API endpoints.

Consider adding method documentation to clarify the purpose, parameters, and return values for each API endpoint:

+/**
+ * Makes a request to change the user's phone number
+ * 
+ * @param token Authorization token
+ * @param changeRequest Map containing new phone number details
+ * @return Response from the server
+ */
@POST(ApiEndPoints.changePhoneNo)
Call<ResponseBody> changePhoneNo(@Header("Authorization") String token,
                                 @Body Map<String, String> changeRequest);
app/src/org/commcare/activities/LoginActivity.java (2)

143-145: Commented code needs cleanup

There is commented code referencing the old ConnectIDManager class that should be updated or removed.

Update the commented code to match the new naming convention or remove it if it's no longer needed:

-//        appLaunchedFromConnect = ConnectIDManager.wasAppLaunchedFromConnect(presetAppId);
+//        appLaunchedFromConnect = PersonalIdManager.wasAppLaunchedFromConnect(presetAppId);

214-215: Inconsistency in comment wording

The comment still uses "PersonalId" rather than the consistent naming pattern "PersonalID" that matches the class name (PersonalIdManager).

Update the comment to use consistent capitalization:

-//See whether login is managed by PersonalId
+//See whether login is managed by PersonalID
app/src/org/commcare/connect/ConnectConstants.java (2)

3-7: Update class comment to reflect "PersonalID" terminology.

The class comments still refer to "ConnectID" but should be updated to maintain consistency with the PersonalID renaming.

/**
- * Constants used for ConnectID, i.e. when passing params to activities
+ * Constants used for PersonalID, i.e. when passing params to activities
 *
 * @author dviggiano
 */

1-1: Consider renaming package to org.commcare.personalid.

For complete consistency in the rename from "connectid" to "personalid", consider renaming the package structure as well.

-package org.commcare.connect;
+package org.commcare.personalid;
app/src/org/commcare/connect/PersonalIdManager.java (3)

79-82: Consider renaming Connect-prefixed constants for complete consistency.

For complete consistency in the rename effort, consider updating these constants to use "PersonalId" prefix instead of "Connect".

-    private static final String CONNECT_HEARTBEAT_WORKER = "connect_heartbeat_worker";
+    private static final String PERSONALID_HEARTBEAT_WORKER = "personalid_heartbeat_worker";
    private static final long PERIODICITY_FOR_HEARTBEAT_IN_HOURS = 4;
    private static final long BACKOFF_DELAY_FOR_HEARTBEAT_RETRY = 5 * 60 * 1000L; // 5 mins
-    private static final String CONNECT_HEARTBEAT_REQUEST_NAME = "connect_hearbeat_periodic_request";
+    private static final String PERSONALID_HEARTBEAT_REQUEST_NAME = "personalid_hearbeat_periodic_request";

159-159: Update the tag reference to match the renamed constant.

If you rename CONNECT_HEARTBEAT_WORKER to PERSONALID_HEARTBEAT_WORKER, make sure to update this reference as well.

-                            .addTag(CONNECT_HEARTBEAT_WORKER)
+                            .addTag(PERSONALID_HEARTBEAT_WORKER)

167-167: Update the request name reference to match the renamed constant.

If you rename CONNECT_HEARTBEAT_REQUEST_NAME to PERSONALID_HEARTBEAT_REQUEST_NAME, make sure to update this reference as well.

-                    CONNECT_HEARTBEAT_REQUEST_NAME,
+                    PERSONALID_HEARTBEAT_REQUEST_NAME,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f16fbb and a20f24a.

📒 Files selected for processing (39)
  • app/AndroidManifest.xml (1 hunks)
  • app/res/layout/screen_personalid_name.xml (1 hunks)
  • app/res/layout/screen_personalid_phoneno.xml (1 hunks)
  • app/res/navigation/nav_graph_personalid.xml (6 hunks)
  • app/res/values/strings.xml (8 hunks)
  • app/src/org/commcare/activities/CommCareSetupActivity.java (5 hunks)
  • app/src/org/commcare/activities/DispatchActivity.java (4 hunks)
  • app/src/org/commcare/activities/HomeScreenBaseActivity.java (0 hunks)
  • app/src/org/commcare/activities/LoginActivity.java (16 hunks)
  • app/src/org/commcare/activities/LoginActivityUIController.java (4 hunks)
  • app/src/org/commcare/activities/StandardHomeActivity.java (2 hunks)
  • app/src/org/commcare/activities/StandardHomeActivityUIController.java (4 hunks)
  • app/src/org/commcare/activities/connect/PersonalIdActivity.java (4 hunks)
  • app/src/org/commcare/android/database/connect/models/ConnectLinkedAppRecord.java (2 hunks)
  • app/src/org/commcare/android/database/connect/models/ConnectUserRecord.java (1 hunks)
  • app/src/org/commcare/android/database/connect/models/ConnectUserRecordV13.java (1 hunks)
  • app/src/org/commcare/android/database/connect/models/ConnectUserRecordV5.java (1 hunks)
  • app/src/org/commcare/android/logging/ReportingUtils.java (2 hunks)
  • app/src/org/commcare/connect/ConnectConstants.java (2 hunks)
  • app/src/org/commcare/connect/PersonalIdManager.java (21 hunks)
  • app/src/org/commcare/connect/database/ConnectAppDatabaseUtil.java (2 hunks)
  • app/src/org/commcare/connect/database/ConnectJobUtils.java (2 hunks)
  • app/src/org/commcare/connect/network/ApiPersonalId.java (1 hunks)
  • app/src/org/commcare/connect/network/ConnectNetworkServiceFactory.kt (2 hunks)
  • app/src/org/commcare/connect/network/ConnectSsoHelper.java (3 hunks)
  • app/src/org/commcare/connect/network/connectId/ApiClient.java (0 hunks)
  • app/src/org/commcare/connect/network/connectId/ApiService.java (2 hunks)
  • app/src/org/commcare/connect/workers/ConnectHeartbeatWorker.kt (1 hunks)
  • app/src/org/commcare/fragments/SelectInstallModeFragment.java (2 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdBackupCodeFragment.java (9 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdBiometricConfigFragment.java (4 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java (4 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdNameFragment.java (1 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (1 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdPhoneVerificationFragment.java (1 hunks)
  • app/src/org/commcare/google/services/analytics/FirebaseAnalyticsUtil.java (2 hunks)
  • app/src/org/commcare/network/CommcareRequestGenerator.java (2 hunks)
  • app/src/org/commcare/utils/CrashUtil.java (0 hunks)
  • app/src/org/commcare/utils/PhoneNumberHelper.java (1 hunks)
💤 Files with no reviewable changes (3)
  • app/src/org/commcare/utils/CrashUtil.java
  • app/src/org/commcare/connect/network/connectId/ApiClient.java
  • app/src/org/commcare/activities/HomeScreenBaseActivity.java
🧰 Additional context used
🧠 Learnings (1)
app/src/org/commcare/android/database/connect/models/ConnectUserRecordV5.java (1)
Learnt from: pm-dimagi
PR: dimagi/commcare-android#2847
File: app/src/org/commcare/android/database/connect/models/ConnectUserRecordV5.java:72-76
Timestamp: 2025-01-26T14:32:09.266Z
Learning: In ConnectUserRecordV5, initializing lastPasswordDate and connectTokenExpiration to new Date() in the constructor is intentional.
🧬 Code Graph Analysis (11)
app/src/org/commcare/android/database/connect/models/ConnectUserRecordV13.java (1)
app/src/org/commcare/connect/ConnectConstants.java (1)
  • ConnectConstants (8-60)
app/src/org/commcare/android/database/connect/models/ConnectUserRecord.java (1)
app/src/org/commcare/connect/ConnectConstants.java (1)
  • ConnectConstants (8-60)
app/src/org/commcare/android/database/connect/models/ConnectUserRecordV5.java (1)
app/src/org/commcare/connect/ConnectConstants.java (1)
  • ConnectConstants (8-60)
app/src/org/commcare/google/services/analytics/FirebaseAnalyticsUtil.java (1)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/connect/database/ConnectJobUtils.java (1)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/fragments/SelectInstallModeFragment.java (1)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/activities/LoginActivityUIController.java (1)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/network/CommcareRequestGenerator.java (1)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/activities/CommCareSetupActivity.java (3)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/connect/ConnectConstants.java (1)
  • ConnectConstants (8-60)
app/src/org/commcare/google/services/analytics/AnalyticsParamValue.java (1)
  • AnalyticsParamValue (7-169)
app/src/org/commcare/connect/network/ConnectSsoHelper.java (4)
app/src/org/commcare/connect/PersonalIdManager.java (1)
  • PersonalIdManager (63-664)
app/src/org/commcare/connect/network/ApiPersonalId.java (1)
  • ApiPersonalId (46-413)
app/src/org/commcare/connect/workers/ConnectHeartbeatWorker.kt (1)
  • context (12-28)
app/src/org/commcare/CommCareApplication.java (1)
  • CommCareApplication (154-1260)
app/src/org/commcare/connect/network/connectId/ApiService.java (1)
app/src/org/commcare/connect/network/connectId/ApiEndPoints.java (1)
  • ApiEndPoints (3-34)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Lint Code Base
🔇 Additional comments (76)
app/src/org/commcare/fragments/personalId/PersonalIdNameFragment.java (1)

1-1: Renamed package to reflect PersonalID feature.
The package declaration has been updated to org.commcare.fragments.personalId, matching the new directory structure. Ensure that the file path and all related navigation XML entries have been moved accordingly.

app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (1)

1-1: Renamed package to reflect PersonalID feature.
The package declaration has been updated to org.commcare.fragments.personalId. Verify that this aligns with your directory rename and that all navigation graph and layout tools:context entries have been updated to this new package.

app/src/org/commcare/google/services/analytics/FirebaseAnalyticsUtil.java (2)

12-12: Swapped import to use PersonalIdManager.
The import for ConnectIDManager has been correctly replaced with PersonalIdManager. This aligns analytics user‐property checks with the new PersonalID management API.


107-108: Use PersonalIdManager to report login state.
The call to PersonalIdManager.getInstance().isloggedIn() replaces the old ConnectID check. Confirm that isloggedIn() returns the intended boolean and that no side effects are introduced in analytics logging.

app/src/org/commcare/android/database/connect/models/ConnectUserRecord.java (1)

73-73: Initialize registrationPhase with new PersonalID constant.
The constructor now sets registrationPhase to ConnectConstants.PERSONALID_NO_ACTIVITY. This correctly reflects the renamed task‐ID offset.

app/src/org/commcare/activities/StandardHomeActivity.java (1)

12-12: Swapped import to use PersonalIdManager.
The import for ConnectIDManager has been updated to PersonalIdManager. Ensure this change is propagated wherever ConnectIDManager was used.

app/src/org/commcare/android/database/connect/models/ConnectUserRecordV13.java (1)

57-57: Updated constant name to align with PersonalID terminology.

The initialization of registrationPhase has been properly updated to use ConnectConstants.PERSONALID_NO_ACTIVITY instead of the previous "CONNECT_" prefixed constant, maintaining consistent behavior while adopting the new naming convention.

app/src/org/commcare/android/database/connect/models/ConnectUserRecordV5.java (1)

78-78: Updated constant name to align with PersonalID terminology.

The initialization of registrationPhase has been properly updated to use ConnectConstants.PERSONALID_NO_ACTIVITY instead of the previous "CONNECT_" prefixed constant, maintaining consistent behavior while adopting the new naming convention.

app/src/org/commcare/fragments/personalId/PersonalIdPhoneVerificationFragment.java (1)

1-1: Updated package name from connectId to personalId.

The package declaration has been correctly updated to use the new personalId naming convention, consistent with the broader renaming effort throughout the codebase.

app/res/layout/screen_personalid_phoneno.xml (1)

10-10: Updated tools:context path to reflect new package structure.

The tools:context attribute has been updated to point to the renamed package path org.commcare.fragments.personalId, ensuring the layout editor can properly resolve the fragment reference.

app/src/org/commcare/connect/database/ConnectJobUtils.java (2)

15-15: Updated import statement to use PersonalIdManager.

The import statement has been correctly changed to reference the renamed manager class.


442-442: Updated manager class reference from ConnectIDManager to PersonalIdManager.

The code now properly references the renamed PersonalIdManager class while maintaining the same functionality of checking whether a user is logged in.

app/src/org/commcare/fragments/SelectInstallModeFragment.java (2)

25-25: Import Updated for Renamed Class

The import has been correctly updated to reference PersonalIdManager instead of ConnectIDManager, aligning with the PR objective to rename everything from connectid to personalid.


207-207: Updated Manager Class Reference

The code correctly updates the reference to PersonalIdManager and maintains the same functionality by calling isloggedIn() on the new class.

app/res/layout/screen_personalid_name.xml (1)

12-12: Updated Fragment Package Reference

The tools:context attribute correctly references the new package path org.commcare.fragments.personalId.PersonalIdNameFragment, aligning with the renaming effort from connectId to personalId.

app/src/org/commcare/connect/network/ConnectNetworkServiceFactory.kt (1)

4-4: Import Updated for Renamed Manager Class

The import has been updated correctly to reference PersonalIdManager instead of ConnectIDManager.

app/src/org/commcare/android/logging/ReportingUtils.java (2)

6-6: Import Updated for Renamed Manager Class

The import statement correctly references the renamed PersonalIdManager class.


145-146: Updated Manager References in getUserForCrashes Method

The code correctly updates references to use PersonalIdManager instead of ConnectIDManager while maintaining the same functionality for retrieving the user ID for crash reports.

app/AndroidManifest.xml (1)

174-174: Class rename from ConnectIdActivity to PersonalIdActivity looks good.

The activity declaration has been updated to reference the renamed PersonalIdActivity class, which aligns with the PR's objective of renaming "connectid" to "personalid" throughout the codebase.

app/src/org/commcare/activities/LoginActivityUIController.java (4)

3-4: Static imports properly updated to reference PersonalIdManager.

The import statements have been updated to reference the renamed PersonalIdManager class instead of ConnectIDManager, maintaining the same enum values (Connect and Unmanaged).


29-29: Import updated from ConnectIDManager to PersonalIdManager.

The import has been updated to reflect the renamed manager class, which aligns with the PR's objective of renaming connectid to personalid.


540-540: Manager class reference updated in refreshConnectView method.

The code now references the renamed PersonalIdManager class when retrieving the app state, while maintaining the same functionality.


553-553: Login check now references PersonalIdManager.

The code now references the PersonalIdManager singleton instance when checking if the user is logged in, maintaining the same functionality with the renamed class.

app/src/org/commcare/utils/PhoneNumberHelper.java (1)

173-173: Updated registration phase constant to use PERSONALID prefix.

The code now references the renamed constant PERSONALID_REGISTRATION_CONFIRM_PIN instead of the previous CONNECT_REGISTRATION_CONFIRM_PIN, consistent with the renaming effort.

app/src/org/commcare/network/CommcareRequestGenerator.java (3)

11-11: Import updated from ConnectIDManager to PersonalIdManager.

The import has been updated to reflect the renamed manager class, consistent with the PR's objective.


179-180: Updated token retrieval to use PersonalIdManager.

The method now calls getHqTokenIfLinked on PersonalIdManager instead of ConnectIDManager while maintaining the same authentication behavior.


183-186: Updated isSeatedAppLinkedToPersonalId call to use PersonalIdManager.

The conditional check now references PersonalIdManager instead of ConnectIDManager while maintaining the same functionality of checking if the current app is linked to the user's personal ID.

app/src/org/commcare/activities/StandardHomeActivityUIController.java (4)

20-20: Import statement correctly updated.

The import statement has been properly updated from ConnectIDManager to PersonalIdManager as part of the ConnectID to PersonalID renaming effort.


79-79: Method call properly updated.

The method call has been correctly updated to use PersonalIdManager instead of ConnectIDManager while maintaining the same method signature and parameters.


115-116: Consistent renaming of intent extra and method call.

Both the intent extra key (PERSONALID_MANAGED_LOGIN instead of CONNECTID_MANAGED_LOGIN) and the method call to shouldShowSecondaryPhoneConfirmationTile have been properly updated to use the new PersonalID naming convention.


125-125: Updated user retrieval method call.

The method call to retrieve the user has been correctly updated to use PersonalIdManager while maintaining the same functionality.

app/src/org/commcare/connect/workers/ConnectHeartbeatWorker.kt (4)

8-9: Import statements correctly updated.

The import statements have been properly updated to use PersonalIdManager and ApiPersonalId instead of their ConnectID counterparts.


17-17: Method call properly updated.

The method call to check login status has been correctly updated to use PersonalIdManager.


22-22: Updated user retrieval method call.

The method call to retrieve the user has been correctly updated to use PersonalIdManager.


24-24: API class reference updated.

The method call has been properly updated to use ApiPersonalId instead of ApiConnectId while maintaining the same functionality.

app/src/org/commcare/fragments/personalId/PersonalIdBackupCodeFragment.java (7)

1-1: Package name updated correctly.

The package declaration has been properly updated from connectId to personalId as part of the renaming effort.


13-13: Import statements correctly updated.

The import statements have been properly updated to reference the new PersonalIdActivity, PersonalIdManager, and ApiPersonalId classes.

Also applies to: 16-16, 19-19


182-182: API and manager method calls properly updated.

All calls to API methods and manager methods have been correctly updated to use ApiPersonalId and PersonalIdManager instead of their ConnectID counterparts.

Also applies to: 218-218, 281-282


320-321: Manager instantiation updated correctly.

The instance creation and method calls for the ID manager have been correctly updated to use PersonalIdManager.


340-340: Activity class cast updated.

The class cast has been properly updated to use PersonalIdActivity instead of ConnectIdActivity.


359-359: Constants properly updated.

The navigation-related constants have been correctly updated to use the PERSONALID_ prefix instead of CONNECT_ prefix.

Also applies to: 370-370, 379-379


365-365: Manager method call updated.

The method call to retrieve failure attempts has been correctly updated to use PersonalIdManager.

app/res/navigation/nav_graph_personalid.xml (1)

10-10: Fragment class references properly updated.

All fragment class references in the navigation graph have been correctly updated to use the new package path org.commcare.fragments.personalId and the renamed fragment classes with the PersonalId prefix instead of ConnectId.

Also applies to: 25-25, 46-46, 99-99, 126-126, 142-142

app/src/org/commcare/connect/database/ConnectAppDatabaseUtil.java (1)

6-6: Consistent renaming of ConnectIDManager to PersonalIdManager

The import and usage of PersonalIdManager instead of ConnectIDManager aligns with the PR objective of renaming everything from "connectid" to "personalid".

Also applies to: 13-13, 50-50

app/src/org/commcare/activities/CommCareSetupActivity.java (2)

29-29: Thorough replacement of ConnectIDManager with PersonalIdManager

The import statement and all instances of ConnectIDManager have been consistently replaced with PersonalIdManager, while maintaining the same method signatures. This aligns with the PR objective of renaming "connectid" to "personalid" throughout the codebase.

Also applies to: 177-177, 426-426, 499-499, 504-504, 630-631, 633-634, 641-645


123-124:

Details

✅ Verification successful

Menu item text inconsistency with underlying implementation

The menu item for signing in is still using the "Connect" terminology:

menu.add(0, MENU_CONNECT_SIGN_IN, 3, getString(R.string.login_menu_connect_sign_in));

But it now launches the renamed Personal ID functionality:

PersonalIdManager.getInstance().launchPersonalId(this, ConnectConstants.COMMCARE_SETUP_CONNECT_LAUNCH_REQUEST_CODE);

This could cause confusion for users if the UI terminology doesn't match the underlying implementation. Consider checking if the string resource R.string.login_menu_connect_sign_in has been updated to use "Personal ID" terminology.

Also applies to: 630-631


🏁 Script executed:

#!/bin/bash
# Check the string resource for the Connect/PersonalID sign-in menu item
cat app/res/values/strings.xml | grep -A 1 "login_menu_connect_sign_in"

Length of output: 150


🏁 Script executed:

#!/bin/bash
grep -A1 "login_menu_connect_forget" app/res/values/strings.xml

Length of output: 141


No changes needed: menu text already uses “PersonalID” terminology.

The string resources have been updated as follows:

  • login_menu_connect_sign_in: “Sign up for PersonalID”
  • login_menu_connect_forget: “Forget PersonalID user”

This aligns the UI text with the underlying PersonalID implementation.

app/src/org/commcare/connect/network/ConnectSsoHelper.java (1)

10-10: Consistent replacement of ConnectIDManager with PersonalIdManager and ApiConnectId with ApiPersonalId

The import and all usages of ConnectIDManager have been replaced with PersonalIdManager, and all calls to ApiConnectId have been replaced with ApiPersonalId. These changes maintain the same method signatures and align with the PR objective.

Also applies to: 109-109, 114-114, 121-121, 133-133, 137-137

app/src/org/commcare/activities/DispatchActivity.java (1)

15-15: Consistent replacement of ConnectIDManager with PersonalIdManager and intent extra key renaming

The import and all usages of ConnectIDManager have been replaced with PersonalIdManager, and the intent extra key has been renamed from CONNECTID_MANAGED_LOGIN to PERSONALID_MANAGED_LOGIN. These changes align with the PR objective.

Also applies to: 205-209, 325-325, 473-473

app/res/values/strings.xml (6)

406-407: String resources updated correctly from ConnectID to PersonalID

The string resources for identity management have been systematically renamed from "ConnectID" to "PersonalID", maintaining consistent capitalization patterns.


409-415: Consistent renaming of user-facing messages

All user-facing messages have been updated to use "PersonalID" instead of "ConnectID", which is aligned with the PR's objective.


472-479: Recovery flow strings updated properly

Recovery-related string resources have been updated to use the new "PersonalID" branding.


510-519: Configuration and registration strings updated correctly

All configuration and registration UI text has been appropriately renamed to use "PersonalID".


645-647: Menu action strings updated consistently

Menu options related to identity management have been correctly renamed to use "PersonalID".


878-888: Login and access control strings renamed properly

All login, authentication, and access control related strings now reflect the "PersonalID" branding.

app/src/org/commcare/fragments/personalId/PersonalIdBiometricConfigFragment.java (5)

1-1: Package name updated correctly

The package name has been updated from connectId to personalId, consistent with the overall renaming strategy.


17-20: Imports updated consistently

Imports have been correctly updated to reference renamed classes:

  • PersonalIdActivity instead of ConnectIdActivity
  • PersonalIdManager instead of ConnectIDManager

223-226: Constants and manager class references updated properly

Constants have been renamed from CONNECT_UNLOCK_PIN to PERSONALID_UNLOCK_PIN and the manager class reference has been updated from ConnectIDManager to PersonalIdManager.


250-257: Navigation and constants updated in error handling path

The constant used for error handling has been properly renamed from CONNECT_BIOMETRIC_ENROLL_FAIL to PERSONALID_BIOMETRIC_ENROLL_FAIL.


259-262: Activity cast updated in navigation method

The activity cast has been correctly updated from (ConnectIdActivity) to (PersonalIdActivity).

app/src/org/commcare/activities/connect/PersonalIdActivity.java (4)

7-13: Imports updated correctly

Imports have been properly updated to reference the renamed classes and packages:

  • PersonalIdBiometricConfigFragment instead of ConnectIdBiometricConfigFragment
  • PersonalIdManager instead of ConnectIDManager
  • PersonalIdPhoneFragmentDirections instead of ConnectIdPhoneFragmentDirections

21-21: Class name updated consistently

The class has been renamed from ConnectIdActivity to PersonalIdActivity in line with the overall renaming effort.


41-42: Constants updated in activity result handling

The constant used in onActivityResult has been properly renamed from CONNECT_UNLOCK_PIN to PERSONALID_UNLOCK_PIN.


86-96: Manager class and navigation references updated properly

The manager class reference has been correctly updated from ConnectIDManager to PersonalIdManager, including the enum reference for status.

app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java (6)

1-1: Package name updated correctly

The package name has been updated from connectId to personalId, consistent with the overall renaming strategy.


12-15: Imports updated consistently

Imports have been correctly updated to reference renamed classes:

  • PersonalIdActivity instead of ConnectIdActivity
  • PersonalIdManager instead of ConnectIDManager

119-119: Activity cast updated properly

The activity cast has been correctly updated from (ConnectIdActivity) to (PersonalIdActivity).


121-121: Constants updated in switch statement

Constants have been properly renamed from CONNECT_REGISTRATION_SUCCESS, CONNECT_RECOVERY_SUCCESS to PERSONALID_REGISTRATION_SUCCESS, PERSONALID_RECOVERY_SUCCESS.


127-133: Recovery flow constants and manager calls updated

Constants and manager class references have been properly updated in the recovery flow:

  • PERSONALID_RECOVERY_WRONG_PIN instead of CONNECT_RECOVERY_WRONG_PIN
  • PersonalIdManager instead of ConnectIDManager

157-158: Manager and constants updated in success flow

The manager class and constants have been correctly updated in the success flow:

  • PersonalIdManager instead of ConnectIDManager
  • PERSONALID_NO_ACTIVITY instead of CONNECT_NO_ACTIVITY
app/src/org/commcare/connect/network/connectId/ApiService.java (1)

16-17: Code formatting improvement

The line formatting changes improve readability by breaking long method signatures into multiple lines.

Also applies to: 20-21, 39-40, 46-47

app/src/org/commcare/connect/network/ApiPersonalId.java (1)

46-46: Class renamed for consistency

The class has been renamed from ApiConnectId to ApiPersonalId to align with the global renaming effort.

app/src/org/commcare/activities/LoginActivity.java (5)

4-6: Updated import statements for the renamed manager

The static imports have been correctly updated to reference PersonalIdManager instead of ConnectIDManager.


38-38: Renamed class references and constants

The references to ConnectIDManager have been correctly updated to PersonalIdManager, and the constant CONNECTID_MANAGED_LOGIN has been renamed to PERSONALID_MANAGED_LOGIN.

Also applies to: 118-118, 120-121


139-141: Initialization of renamed manager class

The initialization and method calls have been updated to use PersonalIdManager instead of ConnectIDManager.


950-952: Method renamed for consistency

The method loginManagedByPersonalId() has been renamed from loginManagedByConnectId() but still performs the same logical check.


475-476:

Details

❌ Incorrect review comment

Inconsistent capitalization in method name

The line mentions personalIdManager.checkPersonalIdLink but it's unclear if the method is using the correct capitalization pattern. If the class is consistently using PersonalID in other method names, this should be made consistent.

Check if other methods in PersonalIdManager use PersonalID or PersonalId in their method names and ensure consistency:


🏁 Script executed:

#!/bin/bash
# Check PersonalIdManager method naming patterns
rg -A 1 "class PersonalIdManager" | head -n 20
rg "personalId|PersonalId" --files-with-matches --type java | xargs grep -l "public.*[pP]ersonalId"

Length of output: 1102


Ignore capitalization concern in checkPersonalIdLink

All class and method names in the Personal ID flow consistently use “PersonalId” (lowercase “d”), including PersonalIdManager.checkPersonalIdLink(...). There are no occurrences of “PersonalID” with an uppercase “ID” elsewhere in the codebase, so no change is needed here.

Likely an incorrect or invalid review comment.


public void performSecondaryPhoneVerification() {
ConnectIDManager.getInstance().beginSecondaryPhoneVerification(this, ConnectConstants.STANDARD_HOME_CONNECT_LAUNCH_REQUEST_CODE);
PersonalIdManager.getInstance().beginSecondaryPhoneVerification(this, ConnectConstants.STANDARD_HOME_CONNECT_LAUNCH_REQUEST_CODE);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Broken constant reference in secondary phone flow.
The code still references ConnectConstants.STANDARD_HOME_CONNECT_LAUNCH_REQUEST_CODE. It should be updated to the corresponding PersonalID constant (e.g., PERSONALID_*). Otherwise this will fail to compile or invoke the wrong request code.

🤖 Prompt for AI Agents
In app/src/org/commcare/activities/StandardHomeActivity.java at line 273,
replace the incorrect constant
ConnectConstants.STANDARD_HOME_CONNECT_LAUNCH_REQUEST_CODE with the appropriate
PersonalIdManager constant for the secondary phone verification request code,
such as PersonalIdManager.PERSONALID_SECONDARY_PHONE_VERIFICATION_REQUEST_CODE,
to ensure the correct constant is used and prevent compilation or runtime
errors.


fun createConnectIdNetworkSerive(): ConnectNetworkService {
authInterceptor.setCredential(HttpUtils.getCredential(ConnectIDManager.getInstance().getConnectToken()))
authInterceptor.setCredential(HttpUtils.getCredential(PersonalIdManager.getInstance().getConnectToken()))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Updated Manager Class Method Call

The code correctly uses PersonalIdManager.getInstance() to retrieve the connect token, maintaining the same functionality while using the renamed class.


🏁 Script executed:

#!/bin/bash
# Check if there are any remaining references to ConnectIDManager class in the codebase
echo "Searching for any remaining references to ConnectIDManager..."
rg "ConnectIDManager" --type-not=binary

Length of output: 203


🏁 Script executed:

#!/bin/bash
# Correctly search for any remaining references to ConnectIDManager
echo "Searching for any remaining references to ConnectIDManager..."
rg -a "ConnectIDManager"

Length of output: 300


Remove outdated ConnectIDManager reference in LoginActivity

A leftover commented line in LoginActivity.java still mentions the old ConnectIDManager. Please remove or update this to reflect the new PersonalIdManager API:

• app/src/org/commcare/activities/LoginActivity.java
– Commented out line:
java // appLaunchedFromConnect = ConnectIDManager.wasAppLaunchedFromConnect(presetAppId);

🤖 Prompt for AI Agents
In app/src/org/commcare/activities/LoginActivity.java around the commented line
referencing ConnectIDManager, remove or update the outdated comment that
mentions ConnectIDManager to use the new PersonalIdManager API instead, ensuring
consistency with the renamed class throughout the codebase.

Comment on lines +205 to 209
PersonalIdManager.getInstance().goToConnectJobsList(this);
} else if(redirectToConnectOpportunityInfo) {
redirectToConnectOpportunityInfo = false;
ConnectIDManager.getInstance().goToActiveInfoForJob(this, true);
PersonalIdManager.getInstance().goToActiveInfoForJob(this, true);
} else {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Method names still use "Connect" prefix

The methods called on PersonalIdManager still use "Connect" in their names:

  • goToConnectJobsList(this)
  • goToActiveInfoForJob(this, true)

This suggests an incomplete renaming effort, where the class has been renamed but the methods still use the old terminology. If "Connect" is being preserved as a broader concept with "PersonalId" as a component, this might be intentional, but it could lead to confusion in the codebase.


🏁 Script executed:

#!/bin/bash
# Check method naming in PersonalIdManager
grep -rn "goToConnectJobsList\|goToActiveInfoForJob" app/src/org/commcare/connect/PersonalIdManager.java

Length of output: 299


Rename methods to remove the “Connect” prefix

The following methods in PersonalIdManager (and their calls) still use the old “Connect” terminology. To keep naming consistent after the class rename, please update both the declaration and all callsites:

• In app/src/org/commcare/connect/PersonalIdManager.java
– Rename

public void goToConnectJobsList(Context parent)

public void goToJobsList(Context parent)

– Rename

public void goToActiveInfoForJob(Activity activity, boolean allowProgression)

public void goToActiveJobInfo(Activity activity, boolean allowProgression)

• In app/src/org/commcare/activities/DispatchActivity.java (around lines 205–209)
– Update calls to goToConnectJobsList(this)goToJobsList(this)
– Update calls to goToActiveInfoForJob(this, true)goToActiveJobInfo(this, true)

This will align method names with the new PersonalIdManager branding and avoid confusion.

🤖 Prompt for AI Agents
In app/src/org/commcare/activities/DispatchActivity.java around lines 205 to
209, the method calls to PersonalIdManager still use the old "Connect" prefix,
which is inconsistent with the class rename. Rename the method calls from
goToConnectJobsList(this) to goToJobsList(this) and from
goToActiveInfoForJob(this, true) to goToActiveJobInfo(this, true). Also, update
the corresponding method declarations in
app/src/org/commcare/connect/PersonalIdManager.java to match these new names to
maintain consistency across the codebase.

Comment on lines 133 to 136
public void linkToPersonalId(String password) {
connectIdLinked = true;
this.password = password;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inconsistency between method name and field assignment

The method has been renamed from linkToConnectId to linkToPersonalId, but still assigns to the connectIdLinked field.

Update the field reference for consistency:

public void linkToPersonalId(String password) {
-    connectIdLinked = true;
+    personalIdLinked = true;
    this.password = password;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public void linkToPersonalId(String password) {
connectIdLinked = true;
this.password = password;
}
public void linkToPersonalId(String password) {
personalIdLinked = true;
this.password = password;
}
🤖 Prompt for AI Agents
In
app/src/org/commcare/android/database/connect/models/ConnectLinkedAppRecord.java
around lines 133 to 136, the method name was changed to linkToPersonalId but it
still assigns the connectIdLinked field. Update the field assignment to a name
consistent with personalId linkage, such as personalIdLinked, to match the
method name and maintain clarity.

Comment on lines 129 to 131
public void setPersonalIdLinked(boolean linked) {
connectIdLinked = linked;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inconsistency between method name and field name

The setter method has been renamed from setConnectIdLinked() to setPersonalIdLinked(), but still operates on the connectIdLinked field.

Apply the same field renaming as suggested above:

public void setPersonalIdLinked(boolean linked) {
-    connectIdLinked = linked;
+    personalIdLinked = linked;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public void setPersonalIdLinked(boolean linked) {
connectIdLinked = linked;
}
public void setPersonalIdLinked(boolean linked) {
personalIdLinked = linked;
}
🤖 Prompt for AI Agents
In
app/src/org/commcare/android/database/connect/models/ConnectLinkedAppRecord.java
around lines 129 to 131, the setter method name setPersonalIdLinked does not
match the field it modifies, connectIdLinked. Rename the field connectIdLinked
to personalIdLinked to maintain consistency with the method name, and update the
setter to assign the value to personalIdLinked instead.

private static volatile ConnectIDManager manager = null;
private ConnectIdStatus connectStatus = ConnectIdStatus.NotIntroduced;
private static volatile PersonalIdManager manager = null;
private PersonalIdStatus connectStatus = PersonalIdStatus.NotIntroduced;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Rename connectStatus to personalIdStatus for consistency.

Since the enum type has been renamed from ConnectIdStatus to PersonalIdStatus, the variable should also be renamed for consistency.

-    private PersonalIdStatus connectStatus = PersonalIdStatus.NotIntroduced;
+    private PersonalIdStatus personalIdStatus = PersonalIdStatus.NotIntroduced;
🤖 Prompt for AI Agents
In app/src/org/commcare/connect/PersonalIdManager.java at line 88, rename the
variable connectStatus to personalIdStatus to match the renamed enum
PersonalIdStatus. Update all references to this variable accordingly to maintain
consistency with the enum name.


public boolean isloggedIn() {
return connectStatus == ConnectIdStatus.LoggedIn;
return connectStatus == PersonalIdStatus.LoggedIn;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update connectStatus reference to personalIdStatus.

This is another instance where connectStatus should be renamed to personalIdStatus.

-        return connectStatus == PersonalIdStatus.LoggedIn;
+        return personalIdStatus == PersonalIdStatus.LoggedIn;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return connectStatus == PersonalIdStatus.LoggedIn;
return personalIdStatus == PersonalIdStatus.LoggedIn;
🤖 Prompt for AI Agents
In app/src/org/commcare/connect/PersonalIdManager.java at line 176, replace the
variable name connectStatus with personalIdStatus to maintain consistent naming
conventions and correct reference to the intended status variable.


public void completeSignin() {
connectStatus = ConnectIdStatus.LoggedIn;
connectStatus = PersonalIdStatus.LoggedIn;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update connectStatus reference to personalIdStatus.

Another instance where connectStatus should be renamed to personalIdStatus.

-        connectStatus = PersonalIdStatus.LoggedIn;
+        personalIdStatus = PersonalIdStatus.LoggedIn;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
connectStatus = PersonalIdStatus.LoggedIn;
personalIdStatus = PersonalIdStatus.LoggedIn;
🤖 Prompt for AI Agents
In app/src/org/commcare/connect/PersonalIdManager.java at line 212, the variable
connectStatus is used but should be renamed to personalIdStatus to maintain
consistent naming. Replace connectStatus with personalIdStatus in this line to
fix the reference.


public void setStatus(ConnectIdStatus status) {
public void setStatus(PersonalIdStatus status) {
connectStatus = status;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update connectStatus reference to personalIdStatus.

In the setter method for the status, connectStatus should be renamed to personalIdStatus.

-        connectStatus = status;
+        personalIdStatus = status;
🤖 Prompt for AI Agents
In app/src/org/commcare/connect/PersonalIdManager.java at line 546, rename the
variable connectStatus to personalIdStatus in the setter method to correctly
reflect the intended status field. Replace the assignment from connectStatus =
status to personalIdStatus = status.

Comment on lines 116 to 120
if (connectStatus == PersonalIdStatus.NotIntroduced) {
ConnectUserRecord user = ConnectUserDatabaseUtil.getUser(parentActivity);
if (user != null) {
boolean registering = user.getRegistrationPhase() != ConnectConstants.CONNECT_NO_ACTIVITY;
connectStatus = registering ? ConnectIdStatus.Registering : ConnectIdStatus.LoggedIn;
boolean registering = user.getRegistrationPhase() != ConnectConstants.PERSONALID_NO_ACTIVITY;
connectStatus = registering ? PersonalIdStatus.Registering : PersonalIdStatus.LoggedIn;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update connectStatus references to personalIdStatus.

All references to connectStatus should be updated to personalIdStatus for consistency.

-        if (connectStatus == PersonalIdStatus.NotIntroduced) {
+        if (personalIdStatus == PersonalIdStatus.NotIntroduced) {
            ConnectUserRecord user = ConnectUserDatabaseUtil.getUser(parentActivity);
            if (user != null) {
                boolean registering = user.getRegistrationPhase() != ConnectConstants.PERSONALID_NO_ACTIVITY;
-                connectStatus = registering ? PersonalIdStatus.Registering : PersonalIdStatus.LoggedIn;
+                personalIdStatus = registering ? PersonalIdStatus.Registering : PersonalIdStatus.LoggedIn;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (connectStatus == PersonalIdStatus.NotIntroduced) {
ConnectUserRecord user = ConnectUserDatabaseUtil.getUser(parentActivity);
if (user != null) {
boolean registering = user.getRegistrationPhase() != ConnectConstants.CONNECT_NO_ACTIVITY;
connectStatus = registering ? ConnectIdStatus.Registering : ConnectIdStatus.LoggedIn;
boolean registering = user.getRegistrationPhase() != ConnectConstants.PERSONALID_NO_ACTIVITY;
connectStatus = registering ? PersonalIdStatus.Registering : PersonalIdStatus.LoggedIn;
if (personalIdStatus == PersonalIdStatus.NotIntroduced) {
ConnectUserRecord user = ConnectUserDatabaseUtil.getUser(parentActivity);
if (user != null) {
boolean registering = user.getRegistrationPhase() != ConnectConstants.PERSONALID_NO_ACTIVITY;
personalIdStatus = registering ? PersonalIdStatus.Registering : PersonalIdStatus.LoggedIn;
🤖 Prompt for AI Agents
In app/src/org/commcare/connect/PersonalIdManager.java around lines 116 to 120,
replace all occurrences of the variable connectStatus with personalIdStatus to
maintain naming consistency. This includes updating the if condition and any
assignments or checks involving connectStatus to use personalIdStatus instead.

shubham1g5
shubham1g5 previously approved these changes May 17, 2025
Copy link
Contributor

@shubham1g5 shubham1g5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure to rebase feature/connect with master once merged to avoid major conflicts

@pm-dimagi pm-dimagi merged commit 23c071d into master May 17, 2025
5 of 10 checks passed
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.

3 participants