BUG: Child mode onboarding saves wrong data to Supabase for phone, country, and guardian relation fields
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia in patient/lib/presentation/auth/personal_details_screen.dart leggendo il getPersonalInfo getter e il Continue handler, quindi riproduci l'invio in child-mode descritto nell'issue. È completato quando la patient row conserva la relazione selezionata, il numero di telefono del guardian, il paese del bambino e il genere, mentre la mancanza della relazione o del genere impedisce l'invio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- I have searched the existing issues
What happened?
📌 Issue Overview
In the Patient App's Personal Details screen, selecting "For my child" mode causes three fields to be incorrectly mapped in the getPersonalInfo getter, silently corrupting every child-mode registration saved to Supabase.
guardianRelationis assignedguardianPhoneController.textinstead ofselectedRelation. The dropdown value is captured but never read.phoneNois hardcoded tophoneController.text(the adult controller), which is always empty in child mode.countryalways readsselectedCountry(adult picker).selectedChildCountryis set correctly by the child form but ignored in the getter.
Additionally, the Relation and Patient Gender dropdowns are plain DropdownMenu widgets, so _formKey.currentState?.validate() skips them entirely. A user can submit with no relation or gender selected and it passes silently.
🔍 Steps to Reproduce
- Open the Patient App and sign in
- On the Personal Details screen, select For my child from the "Assessment is for?" dropdown
- Fill in child name, child age, select relation "Guardian", select gender "Male", enter guardian phone
+911234567890, and pick a country e.g. India - Tap Continue
- Check the
patienttable row in Supabase
🎯 Expected Behavior
| Field | Expected |
|---|---|
guardian_relation |
"Guardian" |
phone |
"+911234567890" |
country |
"India" |
gender |
"Male" |
🚨 Actual Behavior
| Field | Actual |
|---|---|
guardian_relation |
"+911234567890" (phone stored as relation) |
phone |
"" (always empty in child mode) |
country |
"" (always empty, child picker ignored) |
gender |
"" (dropdown bypasses form validation) |
Root cause in patient/lib/presentation/auth/personal_details_screen.dart:
// guardianRelation gets the phone number, selectedRelation is never read
guardianRelation: isAssessmentForChild ? guardianPhoneController.text : phoneController.text,
// phoneNo always reads the adult controller, empty in child mode
phoneNo: phoneController.text,
// always reads adult country picker, selectedChildCountry is ignored
country: selectedCountry?.displayName ?? '',
📷 Screenshot
Not applicable. The corruption is in the data written to Supabase, not visible in the UI.
💡 Suggested Improvements
Fix the getPersonalInfo getter to branch correctly on isAssessmentForChild:
phoneNo: isAssessmentForChild ? guardianPhoneController.text : phoneController.text,
guardianRelation: isAssessmentForChild ? selectedRelation : '',
country: isAssessmentForChild
? selectedChildCountry?.displayName ?? ''
: selectedCountry?.displayName ?? '',
Add pre-submission checks for selectedRelation and selectedChildGender in the onPressed handler since they are DropdownMenu widgets and are skipped by _formKey.currentState?.validate().
Record
- I agree to follow this project's Code of Conduct
- I want to work on this issue
- Lingua principale
- Dart
- Stelle
- 30
- Fork
- 49
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/NeuroTrack
-
fix(therapist): Method marked @override does not override any inherited methodForse già presa @Muneerali199 l’ha presa 252 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#198 ·
-
fix: Don't use BuildContext across async gaps (use_build_context_synchronously)Forse già presa @Muneerali199 l’ha presa 252 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#197 ·
-
fix(patient): Remove unused and duplicate imports across patient appForse già presa @Muneerali199 l’ha presa 252 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AOSSIE-Org/NeuroTrack#195 ·
-
BUG: Therapy details save button has no loading guard, allowing duplicate submissions that inflate patient regression reportsForse già presa @Varadraj75 l’ha presa 215 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#221 ·
-
BUG: Appointment booking ignores selected time slot, every appointment saved at midnight to SupabaseForse già presa @Varadraj75 l’ha presa 220 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
AOSSIE-Org/NeuroTrack#219 ·
Tutte le issue di AOSSIE-Org/NeuroTrack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
fujidaiti/smooth_sheets#655 ·
I maintainer di solito rispondono entro 1 giorno
-
Drop the decision-issue rule from ARCHITECTURE.mdForse già presa @abianche l’ha presa oggi. Apertachore
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 61/100
I maintainer di solito rispondono entro 1 giorno
-
area: library feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100