feat: Implement startup retry mechanism for custom stations and equalizer persistence
- Added state management for startup retry and custom station handling in `EstadoRadio`. - Created tasks for implementing strict TDD with RED tests for HTTP failure retries and EQ persistence. - Developed verification report to ensure compliance with TDD practices. - Introduced fake services for testing, including `FakeServicioAudio`, `FakeServicioFavoritos`, and `FakeServicioRadio`. - Implemented widget tests for `PantallaInicio` and `PantallaFavoritos` to validate UI behavior with custom stations. - Enhanced `ServicioRadio` to support host rotation and retry logic for API calls. - Established a new configuration file to enforce project constraints and testing rules.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Apply Progress - startup-retry-custom-stations-eq-persistence
|
||||
|
||||
## Status
|
||||
|
||||
- Phase: `apply-partial`
|
||||
- Date: 2026-04-27
|
||||
- Strict TDD mode: active
|
||||
- Runtime verification: blocked (`flutter` CLI is not available in PATH)
|
||||
|
||||
## Fixes implemented for verify findings
|
||||
|
||||
1. **CRITICAL: `mediaItem.add(null)` shadowing bug**
|
||||
- Fixed in `lib/servicios/servicio_audio.dart` inside `playMediaItem(...)`.
|
||||
- Replaced ambiguous `mediaItem.add(null)` with `this.mediaItem.add(null)` in the exception path.
|
||||
|
||||
2. **WARNING: async EQ graph updates fired in loop**
|
||||
- Fixed in `lib/pantallas/pantalla_ajustes.dart`.
|
||||
- `EcualizadorWidget.onCambio` now calls one atomic state update (`estado.cambiarPresetEcualizador(p)`) instead of launching async updates per band in a loop.
|
||||
|
||||
3. **CRITICAL: missing scenario tests**
|
||||
- Expanded `test/estado/estado_radio_test.dart`:
|
||||
- EQ state persists when native EQ is unavailable.
|
||||
- Startup failure leaves visible error and manual reload recovers.
|
||||
- Favorite without own EQ falls back to main EQ from first playback.
|
||||
- Expanded `test/pantallas/pantalla_inicio_test.dart`:
|
||||
- Custom station tap starts playback through `EstadoRadio.reproducir`.
|
||||
- Manual retry button after startup failure triggers a new station load cycle.
|
||||
- Favorites screen shows a custom station after favoriting + reload.
|
||||
- Expanded `test/helpers/fakes.dart` with call counters and per-call failure/data sequencing for deterministic startup/retry tests.
|
||||
|
||||
## TDD Cycle Evidence
|
||||
|
||||
| Cycle | RED-first test intent | GREEN code change | Verification command | RED evidence | GREEN evidence | Result |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 1 | Add missing tests for EQ unavailable, manual retry, custom playback tap, and favorites reload flows | Fix `servicio_audio.dart`, `pantalla_ajustes.dart`, and test fakes | `Get-Command flutter -ErrorAction SilentlyContinue` | `flutter` not found in PATH | Blocked (cannot execute tests) | BLOCKED |
|
||||
| 2 | Keep new/updated tests in place and execute strict runner only | No further production changes after test additions | `flutter test` | Command attempted | `flutter` command not recognized | BLOCKED |
|
||||
|
||||
## Validation commands run
|
||||
|
||||
| Command | Result |
|
||||
|---|---|
|
||||
| `Get-Command flutter -ErrorAction SilentlyContinue` | `FLUTTER_NOT_FOUND` |
|
||||
| `flutter test` | `CommandNotFoundException` (Flutter missing from PATH) |
|
||||
| `flutter build` | Not run (prohibited) |
|
||||
|
||||
## Remaining before verify can pass
|
||||
|
||||
1. Install/expose Flutter in PATH for this environment.
|
||||
2. Run `flutter test` and capture passing evidence for every scenario in `spec.md` (tasks 5.3 and 5.4).
|
||||
Reference in New Issue
Block a user