-
Notifications
You must be signed in to change notification settings - Fork 314
bug: include name and dob in DiffUtil content comparison #2885
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
base: master
Are you sure you want to change the base?
bug: include name and dob in DiffUtil content comparison #2885
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi @jingtang10 , I’m running into the issue below and it’s blocking me. Any guidance you can share would be greatly appreciated.
Logs./gradlew connectedCheck Configuration '_internal-unified-test-platform-android-test-plugin-result-listener-gradle' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-retention' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-apk-installer' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-logcat' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-emulator-control' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-device-info' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-coverage' was resolved during configuration time. Configuration '_internal-unified-test-platform-launcher' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-driver-instrumentation' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-device-provider-gradle' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-device-provider-ddmlib' was resolved during configuration time. Configuration '_internal-unified-test-platform-core' was resolved during configuration time. Configuration '_internal-unified-test-platform-android-test-plugin-host-additional-test-output' was resolved during configuration time. Configuration 'androidTestUtil' was resolved during configuration time. Configuration 'debugAndroidTestAnnotationProcessorClasspath' was resolved during configuration time. Configuration 'debugAndroidTestCompileClasspath' was resolved during configuration time. Configuration 'debugAndroidTestRuntimeClasspath' was resolved during configuration time. Configuration 'kotlinCompilerPluginClasspathDebugAndroidTest' was resolved during configuration time. --- Test Execution ---
Starting 105 tests on Pixel_7_API_33(AVD) - 16 com.google.android.fhir.datacapture.contrib.views.PhoneNumberViewHolderFactoryInstrumentedTest
Tests 18/105 completed. (1 skipped, 0 failed) com.google.android.fhir.datacapture.test.views.DropDownViewHolderFactoryEspressoTest
Tests 60/105 completed. (1 skipped, 1 failed) com.google.android.fhir.datacapture.test.views.QuestionnaireItemDialogMultiSelectViewHolderFactoryEspressoTest
Tests 80/105 completed. (2 skipped, 1 failed) com.google.android.fhir.datacapture.views.factories.AutoCompleteViewHolderFactoryEspressoTest
Tests 107/105 completed. (2 skipped, 3 failed) --- Summary --- Finished 107 tests on Pixel_7_API_33(AVD) - 16 Tests failed: 3 --- Build Report ---
Problems report: /build/reports/problems/problems-report.html FAILURE: Build failed with an exception.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. BUILD FAILED in 2m 13s
|
22f9b3d
to
d6e5a67
Compare
I was able to get I suggest addressing this in a separate issue to keep this MR focused on the patient list update fix. cc @jingtang10 |
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.
Loved the detailed pros vs cons of the alternatives considered in the descriptions. Thanks for the thoroughness!
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.
Thanks you @oscarArismendi for your fix! Appreciate it!
Thanks @LZRS for taking a look.
…fter-patient-details-update
Hi @jingtang10, I see the workflows are pending and haven’t run automatically since this is my first contribution. Could you please help approve them so the checks can run? Thanks! |
started the workflow - sorry i didn't realise it was stopped |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Closes #1308
Description
Fix patient list not refreshing after editing patient details by updating the PatientItemDiffCallback.areContentsTheSame() method to include name and dob field comparisons.
Alternative(s) considered
Option 1: Compare entire object (oldItem == newItem)
Pros: Catches all field changes automatically
Cons: May trigger unnecessary updates for internal fields not visible to users
I've found this solution being dismiss on this MR review.
Option 2: Adapter workaround (submitList(null) then submitList(data))
Code
Pros: Quick fix that bypasses DiffUtil entirely
Cons: Loses DiffUtil's efficient animations and selective updates; treats symptom rather than cause
Option 3: Compare user-visible fields (chosen solution)
Pros: Fixes root cause while maintaining DiffUtil efficiency; updates only when UI-relevant data changes
Cons: Requires maintenance when display fields change
Type
Choose one: Bug fix
Screenshots (if applicable)
Testing
NameChangeAfterAPatientDetailUpdate.mp4
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.