BUG: Appointment booking ignores selected time slot, every appointment saved at midnight to Supabase
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia in appointments_provider.dart, in createAppointment(), e segui come vengono ottenuti la data selezionata, la fascia oraria e il terapeuta. Poi leggi patient_schedule_appointment_model.dart e patient_schedule_appointment_entity.dart per seguire il timestamp fino alla richiesta di consultazione. Il lavoro è completato quando Supabase riceve l’orario selezionato e l’ID del terapeuta, lo slot prenotato diventa non disponibile e viene impedito l’invio duplicato.
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
The appointment booking flow silently discards the time slot the patient selects. Every appointment is written to the Supabase session table with a timestamp of midnight (T00:00:00) on the selected date, regardless of which slot was chosen.
The slot field is captured in PatientScheduleAppointmentModel but toEntity() builds the timestamp using only DateTime.parse(date) - the date-only ISO string from _selectedDate!.toIso8601String(). The slot string is never parsed or merged into the timestamp. PatientScheduleAppointmentEntity has no slot field at all.
Additionally, therapistId is hardcoded to '' in createAppointment() at line 180 of appointments_provider.dart, meaning every booking is inserted with an empty therapist ID.
As a result, the slot availability check which compares booked appointment hours against available slots never matches the midnight row, so the same slot can be booked unlimited times.
🔍 Steps to Reproduce
- Log in as a patient who has an assigned therapist
- Navigate to Appointments → Schedule an Appointment
- Select a service type, a date, and a specific time slot e.g. 10:00 AM
- Tap Schedule It
- Check the
sessiontable in Supabase
🎯 Expected Behavior
The inserted row should have timestamp = 2025-04-15T10:00:00.000 reflecting the
selected slot. The slot should then appear as unavailable for the same date.
🚨 Actual Behavior
The inserted row has timestamp = 2025-04-15T00:00:00.000 regardless of the
selected slot. therapist_id is empty string. The same slot remains bookable
indefinitely since the availability check never matches a midnight timestamp.
Root cause in appointments_provider.dart line 180-183:
therapistId: '', // hardcoded empty string
date: _selectedDate!.toIso8601String(), // midnight date only
slot: _selectedTimeSlot, // captured but never used downstream
Root cause in patient_schedule_appointment_model.dart line 34:
timestamp: DateTime.parse(date), // slot string never parsed or merged
📷 Screenshot
Not applicable. The corruption is in data written to Supabase.
💡 Suggested Improvements
- In
appointments_provider.dart, parse_selectedTimeSlot(e.g. "10:00 AM")
into hour and minute, then combine with_selectedDateto produce a full DateTime
before passing to the model. Also pass the resolvedtherapistIdfrom the
availability fetch instead of hardcoding''. - In
patient_schedule_appointment_model.dart, updatetoEntity()to accept
and use the time-resolved DateTime rather than parsing the date-only string. - In
patient_schedule_appointment_entity.dart, ensure the full timestamp flows
through totoConsultationRequestEntity()unchanged. - Add an
_isSubmittingguard on the Schedule It button to prevent duplicate
inserts on double tap.
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: Daily activity completions are not saved to Supabase, progress resets on navigationForse già presa @Varadraj75 l’ha presa 224 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#217 ·
Tutte le issue di AOSSIE-Org/NeuroTrack
Issue simili
-
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
-
duration: tiny priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
duobaseio/forui#1249 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Off-by-one error in CharacterRange.length excludes end characters ('z', 'Z', '9', 'ÿ')Forse già presa @TimelordLeo l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 2 giorni
-
[Bug] Missing Simplified Chinese translation for 'balance' and 'lowest' balancer outbound namesApertabug from-telegram platform:android version:v5.9.15
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
hiddify/hiddify-app#2655 ·
I maintainer di solito rispondono entro 1 giorno