fix(simulations): resolve FTD-23 autosave after correction + FTD-24 auto-polling pending jobs

- FTD-23: propagate enabled=false to useAutosave when step is done/correcting, preventing 400 PATCH after correction
- FTD-24: add conditional refetchInterval (3s) in useRapport for pending exercices/modele, 2min timeout with retry UI
- 7 new tests (2 regression + 5 polling), 122/122 green

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann_Kitio 2026-04-23 03:56:57 +03:00
parent bc2a1174d1
commit cab9c8c92b
8 changed files with 379 additions and 20 deletions

View file

@ -99,7 +99,8 @@ export function SimulationForm({
const timer = useTimer(config.dureeMinutes, !isSubmitting)
const idees = useIdees()
const autosave = useAutosave(simulationId, texte, !isSubmitting)
const autosaveEnabled = !isSubmitting && step !== 'done' && step !== 'correcting'
const autosave = useAutosave(simulationId, texte, autosaveEnabled)
// FTD-21 — marquer la simulation en cours pour le resume au refresh.
useEffect(() => {