Skip to content

fix: fix help request validation/save failures during edit#617

Merged
erinc00 merged 1 commit into
developmentfrom
fix/edit-request-save-to-db
May 12, 2026
Merged

fix: fix help request validation/save failures during edit#617
erinc00 merged 1 commit into
developmentfrom
fix/edit-request-save-to-db

Conversation

@AlperKartkaya

Copy link
Copy Markdown
Contributor

What was wrong

  • Existing request location values are stored as labels like Turkey, Istanbul, Kadıköy.
  • The edit form dropdowns expect selector keys like tr, istanbul, kadikoy.
  • So when editing, already-filled location fields could appear empty/unselected.
  • I also found a related save-risk: stored phone values like 90555... could hydrate into an invalid phone input instead
    of 555..., causing validation/save failures during edit.

Fixed

Resolves #613

Changed:

  • android/app/src/main/java/com/neph/features/requesthelp/presentation/RequestHelpScreen.kt
    • Normalizes persisted help type/risk/vulnerable group values back into UI option labels.
    • Converts persisted location labels back into dropdown keys.
    • Normalizes stored Turkish phone numbers with 90 prefix into editable form values.
    • Waits for location options before hydrating an existing draft/edit form.

Added tests:

  • android/app/src/test/java/com/neph/features/requesthelp/presentation/RequestHelpFormStateMappingTest.kt
    • Covers edit-form hydration for persisted labels, dropdown keys, phone normalization, and unknown remote locations.
  • android/app/src/androidTest/java/com/neph/e2e/RequestHelpRepositoryAndroidTest.kt
    • Confirms edited request fields are actually persisted in the local database.

@AlperKartkaya AlperKartkaya requested a review from erinc00 May 12, 2026 17:14
@AlperKartkaya AlperKartkaya changed the title fix: fix help request edit form hydration fix: fix help request validation/save failures during edit May 12, 2026

@erinc00 erinc00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. This fixes the edit-form hydration issue in the right place by mapping persisted values back into the form shape the UI expects. The location label-to-key conversion and phone normalization should prevent the empty dropdown / invalid phone problems during edit, and the added tests cover the main regression paths. Approving and merging.

@erinc00 erinc00 merged commit 975f4c9 into development May 12, 2026
2 checks passed
@AlperKartkaya AlperKartkaya deleted the fix/edit-request-save-to-db branch May 12, 2026 17:21
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.

[BUG] Android edited help request is not reliably reflected after save (local/remote sync inconsistency)

2 participants