airqo-platform / airqo-platform/AirQo-frontend
[Bug] Confirm/download action stays enabled during preview loading or after a preview error
- Lenguaje dominante
- TypeScript
- Estrellas
- 23
- Forks
- 48
- Merge medio
- 15 h 24 min
- PR fusionados (30 d)
- 57
Descripción
# [Bug] Confirm/download action stays enabled during preview loading or after a preview error
## Summary
The primary confirm/download action in the Data Export flow can be clicked while a preview is still loading or after the preview request has failed, letting users bypass validation. This bug exists in **two separate places** — one was fixed before merge, the other was flagged in the final review (submitted after the last batch of inline comments, closest thing to "last word" before merge) and does not appear to have been addressed.
## Where this came from
- CodeRabbit (2026-07-30): "Keep it non-interactive during preview loading as well; otherwise rapid clicks can re-enter `onDownload`" — on the header button in `DataExportHeader.tsx`. **Marked "✅ Addressed in commits 3646289 to 7aa54af"** — this instance appears fixed.
- CodeRabbit (2026-08-04, final review, posted as an "outside diff range" comment so it never became a separate inline thread): "When `isFetchingPreview` is true or `previewError` is set, the primary action remains enabled and still calls `onConfirm`. Users can bypass preview validation while the preview is loading or after it fails." — on the dialog's own primary action in `DataExportPreview.tsx` (~lines 225-233). **No addressed marker** — this instance was the last thing flagged and may still be open.
## Affected files
- `src/nexus/src/modules/data-download/components/DataExportHeader.tsx` (fixed)
- `src/nexus/src/modules/data-download/components/DataExportPreview.tsx` (verify — likely still open)
## Suggested fix
In `DataExportPreview.tsx`, extend the primary action's `disabled` condition to also cover `isFetchingPreview` and `Boolean(previewError)`, matching the fix already applied in `DataExportHeader.tsx`.
## Acceptance criteria
- [ ] Confirm the `DataExportPreview.tsx` primary action is disabled during preview loading
- [ ] Confirm it's disabled while `previewError` is set
- [ ] Both button locations (header and preview dialog) behave consistently
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.