Repository navigation
fix(api): garder sans conflit un lieu toujours ouvert d'une sortie - #543
Merged
Merged
Conversation
…line Fixes #539 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…utes Covers the three criteria of the ticket on GET /v1/me/planned: no hours_unknown for an always-open place, the same timeline as GET /v1/routes/:id/timeline, and a snapshot stored without alwaysOpen read as false. The fictitious place moves into the planning fixtures, deleted with the routes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Plan et décisions : le correctif (premier commit, écrit par GLM, gardé tel quel) ajoute |
3 tasks
The planned place now carries alwaysOpen, required once parsed: the fictitious planning of the Go tests is a parsed PlannedRoute, so its places say they are not always open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résultat et problème
Un lieu « Accessible à toute heure » sans horaires recevait
hours_unknowndans la timeline d'une sortie programmée (GET /v1/me/planned), alors queGET /v1/routes/:id/timelinene lui en mettait aucun, comme le veut D-049. Le snapshot (PlannedRouteSnapshot) ne gardait pasalwaysOpenettimelineOfne le passait pas àcomputeTimeline.PlannedRoutePlaceportealwaysOpen: z.boolean().default(false): un snapshot déjà enregistré sans ce champ se lit avecfalse, sans migration.snapshotOffigealwaysOpendu lieu ;timelineOfle transmet àcomputeTimeline.Limite : la timeline d'une sortie est figée en base à sa programmation. Une sortie déjà programmée avant ce correctif garde son
hours_unknownjusqu'à ce que son départ soit modifié (PATCH, qui recalcule la timeline sur son snapshot, lui aussi sansalwaysOpen, doncfalse). Aucune réécriture des sorties existantes : il n'y a pas de données de production concernées à ce stade.Fixes #539
Écrans : aucun
Dépendance : aucune
Comment vérifier
Le premier commit a été écrit par un agent opencode (GLM) et est gardé tel quel ; le second ajoute les tests des trois critères au niveau HTTP (le test GLM ne couvrait que
timelineOf) ; le troisième ajoutealwaysOpen: falseaux lieux de la sortie fictive des tests du Go (apps/mobile/src/go/testPlanned.ts), que le nouveau champ, obligatoire une fois parsé, faisait échouer au typecheck mobile.apps/api/src/routes/planned.test.ts, « the timeline of a planning and an always-open place (D-049) » :hours_unknownpour le lieu toujours ouvert dansGET /v1/me/planned;GET /v1/routes/:id/timeline?startsAt=, pour la démo et pour un parcours avec un lieu toujours ouvert ;alwaysOpense lit en 200 avecalwaysOpen: falsepartout.Contrôle par mutation en local : sans la ligne
alwaysOpendetimelineOf, les trois tests liés au lieu toujours ouvert échouent.pnpm lint && pnpm typecheck && pnpm testverts en local — lint et typecheck verts sans cache (pnpm turbo run lint typecheck --force) ; tests verts par paquet. Un test jest mobile sans lien (SectionList.test.tsx) a dépassé son délai sous la même charge, vert relancé seul. La suite API complète a eu 4 timeouts de 5 s sous une charge machine de 92, dans des fichiers non touchés, verts une fois relancés seuls.Testé sur iOS / Android (préciser) — si mobile : sans objet, API seule.
Formatage mécanique : non
Risque
Niveau : 1 — champ de snapshot avec défaut à la lecture, sans migration ni effet sur l'accès ; seuls les conflits d'un lieu
always_openchangent.Taille : 3 commits, +5 / −2, +119 / −2 et +1 lignes, tests compris.
Revue OWASP : non déclenchée (règle d'affichage d'horaires, pas d'accès, d'entrée non fiable ni de stockage nouveau).
Retour arrière
Revert de la PR suffisant : aucune migration. Les snapshots enregistrés entre-temps garderaient un champ
alwaysOpenque l'ancien schéma Zod ignore à la lecture.🤖 Generated with Claude Code