-
-
Notifications
You must be signed in to change notification settings - Fork 45
PM-renamed everything from connectid to personalid #3114
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
📝 WalkthroughWalkthroughThis 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 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
Possibly related PRs
Suggested labels
Suggested reviewers
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit 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. Note ⚡️ Faster reviews with cachingCodeRabbit 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 ✨ 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 (
|
There was a problem hiding this 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 issueMissed 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 issueFragment ID reference not updated
There's still a reference to
nav_host_fragment_connectidwhich should be updated tonav_host_fragment_personalidfor consistency.- (NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_connectid); + (NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_personalid);
77-79:⚠️ Potential issueAnother fragment ID reference not updated
Similar to the previous issue, there's another reference to
nav_host_fragment_connectidthat 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 issueLayout reference not updated
The activity layout reference
activity_connect_idshould be updated toactivity_personal_idfor consistency.- setContentView(R.layout.activity_connect_id); + setContentView(R.layout.activity_personal_id);
45-47:⚠️ Potential issueIncomplete constant renaming
While most constants are updated,
ConnectConstants.CONNECT_JOB_INFOis still using the old prefix and should be updated toConnectConstants.PERSONALID_JOB_INFO.- } else if (requestCode == ConnectConstants.CONNECT_JOB_INFO) { + } else if (requestCode == ConnectConstants.PERSONALID_JOB_INFO) {
54-56:⚠️ Potential issueAdditional constant needs updating
The constant
ConnectConstants.BEGIN_REGISTRATIONshould also be updated toConnectConstants.PERSONALID_BEGIN_REGISTRATIONfor 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 issueInconsistency between method name and field operations
The method
severPersonalIdLinkhas been renamed but still clears theconnectIdLinkedfield.Update the field reference:
public void severPersonalIdLink() { - connectIdLinked = false; + personalIdLinked = false; password = ""; linkOffered1 = false; linkOffered2 = false; }
188-188:⚠️ Potential issueInstance of inconsistent field naming in migration method
The
fromV9method still referencesgetConnectIdLinked()in the older record model and assigns toconnectIdLinkedin 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 issuePackage name inconsistency with new naming convention
The file is still in the
connectIdpackage despite the renaming of "connectid" to "personalid" throughout the codebase.The package should be renamed to
personalIdfor 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 issueInconsistent constant naming
The constant
CONNECT_CLIENT_IDstill 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 issueMethod name and string references need updating
The method
retrieveConnectIdTokenSyncand references toConnectTokenURLandConnectConstants.CONNECT_KEY_TOKENstill 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 suggestionSecurity issue with API call implementation
In the
callApimethod, 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.xmlLength 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_title→login_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 toPersonalIdHeartbeatWorkerfor complete consistency.app/src/org/commcare/connect/database/ConnectAppDatabaseUtil.java (1)
34-35: Inconsistent parameter and documentation namingWhile the method has been renamed from
setConnectIdLinkedtosetPersonalIdLinked, the parameter nameconnectIdLinkedand 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 conventionWhile 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:
- Renaming this file and class to
PersonalIdSsoHelperfor full consistency, or- 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 namingWhile the intent extra key has been renamed from
CONNECTID_MANAGED_LOGINtoPERSONALID_MANAGED_LOGIN, the corresponding local variableconnectIdManagedLoginhas not been renamed to follow the same convention.Additionally, the related variable
connectManagedLoginand 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 listenersThe button IDs
connectMessageButtonandconnectMessageButton2should be updated topersonalIdMessageButtonandpersonalIdMessageButton2for 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 updatedThe text view IDs
connectMessageTitleandconnectMessageMessageshould be updated topersonalIdMessageTitleandpersonalIdMessageMessagefor 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 toggleThe button ID
connectMessageButton2should be updated topersonalIdMessageButton2for 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 documentationWhile 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 cleanupThere is commented code referencing the old
ConnectIDManagerclass 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 wordingThe 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 PersonalIDapp/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
📒 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 toorg.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 toorg.commcare.fragments.personalId. Verify that this aligns with your directory rename and that all navigation graph and layouttools:contextentries 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 forConnectIDManagerhas been correctly replaced withPersonalIdManager. This aligns analytics user‐property checks with the new PersonalID management API.
107-108: Use PersonalIdManager to report login state.
The call toPersonalIdManager.getInstance().isloggedIn()replaces the old ConnectID check. Confirm thatisloggedIn()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 setsregistrationPhasetoConnectConstants.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 forConnectIDManagerhas been updated toPersonalIdManager. Ensure this change is propagated whereverConnectIDManagerwas 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
registrationPhasehas been properly updated to useConnectConstants.PERSONALID_NO_ACTIVITYinstead 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
registrationPhasehas been properly updated to useConnectConstants.PERSONALID_NO_ACTIVITYinstead 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
personalIdnaming 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
PersonalIdManagerclass 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 ClassThe import has been correctly updated to reference
PersonalIdManagerinstead ofConnectIDManager, aligning with the PR objective to rename everything from connectid to personalid.
207-207: Updated Manager Class ReferenceThe code correctly updates the reference to
PersonalIdManagerand maintains the same functionality by callingisloggedIn()on the new class.app/res/layout/screen_personalid_name.xml (1)
12-12: Updated Fragment Package ReferenceThe
tools:contextattribute correctly references the new package pathorg.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 ClassThe import has been updated correctly to reference
PersonalIdManagerinstead ofConnectIDManager.app/src/org/commcare/android/logging/ReportingUtils.java (2)
6-6: Import Updated for Renamed Manager ClassThe import statement correctly references the renamed
PersonalIdManagerclass.
145-146: Updated Manager References in getUserForCrashes MethodThe code correctly updates references to use
PersonalIdManagerinstead ofConnectIDManagerwhile 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
ConnectIDManagertoPersonalIdManageras part of the ConnectID to PersonalID renaming effort.
79-79: Method call properly updated.The method call has been correctly updated to use
PersonalIdManagerinstead ofConnectIDManagerwhile maintaining the same method signature and parameters.
115-116: Consistent renaming of intent extra and method call.Both the intent extra key (
PERSONALID_MANAGED_LOGINinstead ofCONNECTID_MANAGED_LOGIN) and the method call toshouldShowSecondaryPhoneConfirmationTilehave 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
PersonalIdManagerwhile 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
PersonalIdManagerandApiPersonalIdinstead 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
ApiPersonalIdinstead ofApiConnectIdwhile 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
connectIdtopersonalIdas part of the renaming effort.
13-13: Import statements correctly updated.The import statements have been properly updated to reference the new
PersonalIdActivity,PersonalIdManager, andApiPersonalIdclasses.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
ApiPersonalIdandPersonalIdManagerinstead 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
PersonalIdActivityinstead ofConnectIdActivity.
359-359: Constants properly updated.The navigation-related constants have been correctly updated to use the
PERSONALID_prefix instead ofCONNECT_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.personalIdand the renamed fragment classes with thePersonalIdprefix instead ofConnectId.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 PersonalIdManagerThe import and usage of
PersonalIdManagerinstead ofConnectIDManageraligns 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 PersonalIdManagerThe import statement and all instances of
ConnectIDManagerhave been consistently replaced withPersonalIdManager, 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_inhas 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.xmlLength 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 ApiPersonalIdThe import and all usages of
ConnectIDManagerhave been replaced withPersonalIdManager, and all calls toApiConnectIdhave been replaced withApiPersonalId. 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 renamingThe import and all usages of
ConnectIDManagerhave been replaced withPersonalIdManager, and the intent extra key has been renamed fromCONNECTID_MANAGED_LOGINtoPERSONALID_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 PersonalIDThe string resources for identity management have been systematically renamed from "ConnectID" to "PersonalID", maintaining consistent capitalization patterns.
409-415: Consistent renaming of user-facing messagesAll 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 properlyRecovery-related string resources have been updated to use the new "PersonalID" branding.
510-519: Configuration and registration strings updated correctlyAll configuration and registration UI text has been appropriately renamed to use "PersonalID".
645-647: Menu action strings updated consistentlyMenu options related to identity management have been correctly renamed to use "PersonalID".
878-888: Login and access control strings renamed properlyAll 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 correctlyThe package name has been updated from
connectIdtopersonalId, consistent with the overall renaming strategy.
17-20: Imports updated consistentlyImports have been correctly updated to reference renamed classes:
PersonalIdActivityinstead ofConnectIdActivityPersonalIdManagerinstead ofConnectIDManager
223-226: Constants and manager class references updated properlyConstants have been renamed from
CONNECT_UNLOCK_PINtoPERSONALID_UNLOCK_PINand the manager class reference has been updated fromConnectIDManagertoPersonalIdManager.
250-257: Navigation and constants updated in error handling pathThe constant used for error handling has been properly renamed from
CONNECT_BIOMETRIC_ENROLL_FAILtoPERSONALID_BIOMETRIC_ENROLL_FAIL.
259-262: Activity cast updated in navigation methodThe activity cast has been correctly updated from
(ConnectIdActivity)to(PersonalIdActivity).app/src/org/commcare/activities/connect/PersonalIdActivity.java (4)
7-13: Imports updated correctlyImports have been properly updated to reference the renamed classes and packages:
PersonalIdBiometricConfigFragmentinstead ofConnectIdBiometricConfigFragmentPersonalIdManagerinstead ofConnectIDManagerPersonalIdPhoneFragmentDirectionsinstead ofConnectIdPhoneFragmentDirections
21-21: Class name updated consistentlyThe class has been renamed from
ConnectIdActivitytoPersonalIdActivityin line with the overall renaming effort.
41-42: Constants updated in activity result handlingThe constant used in
onActivityResulthas been properly renamed fromCONNECT_UNLOCK_PINtoPERSONALID_UNLOCK_PIN.
86-96: Manager class and navigation references updated properlyThe manager class reference has been correctly updated from
ConnectIDManagertoPersonalIdManager, including the enum reference for status.app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java (6)
1-1: Package name updated correctlyThe package name has been updated from
connectIdtopersonalId, consistent with the overall renaming strategy.
12-15: Imports updated consistentlyImports have been correctly updated to reference renamed classes:
PersonalIdActivityinstead ofConnectIdActivityPersonalIdManagerinstead ofConnectIDManager
119-119: Activity cast updated properlyThe activity cast has been correctly updated from
(ConnectIdActivity)to(PersonalIdActivity).
121-121: Constants updated in switch statementConstants have been properly renamed from
CONNECT_REGISTRATION_SUCCESS, CONNECT_RECOVERY_SUCCESStoPERSONALID_REGISTRATION_SUCCESS, PERSONALID_RECOVERY_SUCCESS.
127-133: Recovery flow constants and manager calls updatedConstants and manager class references have been properly updated in the recovery flow:
PERSONALID_RECOVERY_WRONG_PINinstead ofCONNECT_RECOVERY_WRONG_PINPersonalIdManagerinstead ofConnectIDManager
157-158: Manager and constants updated in success flowThe manager class and constants have been correctly updated in the success flow:
PersonalIdManagerinstead ofConnectIDManagerPERSONALID_NO_ACTIVITYinstead ofCONNECT_NO_ACTIVITYapp/src/org/commcare/connect/network/connectId/ApiService.java (1)
16-17: Code formatting improvementThe 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 consistencyThe class has been renamed from
ApiConnectIdtoApiPersonalIdto align with the global renaming effort.app/src/org/commcare/activities/LoginActivity.java (5)
4-6: Updated import statements for the renamed managerThe static imports have been correctly updated to reference
PersonalIdManagerinstead ofConnectIDManager.
38-38: Renamed class references and constantsThe references to
ConnectIDManagerhave been correctly updated toPersonalIdManager, and the constantCONNECTID_MANAGED_LOGINhas been renamed toPERSONALID_MANAGED_LOGIN.Also applies to: 118-118, 120-121
139-141: Initialization of renamed manager classThe initialization and method calls have been updated to use
PersonalIdManagerinstead ofConnectIDManager.
950-952: Method renamed for consistencyThe method
loginManagedByPersonalId()has been renamed fromloginManagedByConnectId()but still performs the same logical check.
475-476:Details
❌ Incorrect review comment
Inconsistent capitalization in method name
The line mentions
personalIdManager.checkPersonalIdLinkbut it's unclear if the method is using the correct capitalization pattern. If the class is consistently usingPersonalIDin other method names, this should be made consistent.Check if other methods in
PersonalIdManagerusePersonalIDorPersonalIdin 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
checkPersonalIdLinkAll 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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())) |
There was a problem hiding this comment.
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=binaryLength 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.
| PersonalIdManager.getInstance().goToConnectJobsList(this); | ||
| } else if(redirectToConnectOpportunityInfo) { | ||
| redirectToConnectOpportunityInfo = false; | ||
| ConnectIDManager.getInstance().goToActiveInfoForJob(this, true); | ||
| PersonalIdManager.getInstance().goToActiveInfoForJob(this, true); | ||
| } else { |
There was a problem hiding this comment.
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.javaLength 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.
| public void linkToPersonalId(String password) { | ||
| connectIdLinked = true; | ||
| this.password = password; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| public void setPersonalIdLinked(boolean linked) { | ||
| connectIdLinked = linked; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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.
| 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
left a comment
There was a problem hiding this 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
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