Repository navigation
fix(app): resolve evidence upload silently failing after complete_maintenance - #63
Merged
Merged
Conversation
After complete_maintenance lands, fetchAvailableJobs() drops the finished job and an effect auto-reassigns selectedJobId to the next available one. A separate effect was clearing completeSig on ANY selectedJobId change, including this synthetic one - killing the pending evidence upload before it could fire, silently, with no visible error. Added an autoSelectedJob ref to distinguish the synthetic reassignment from a user-driven job switch. Only user actions clear completeSig now.
EvidenceUploader only rendered a preview/filename when the selected file was an image (preview state), so selecting a PDF appeared to do nothing - the file was actually staged (setFile ran fine), there was just no visual confirmation. Now renders based on the file state instead of preview: shows a generic document icon for non-image files, the filename either way, and a new hint clarifying the file uploads once maintenance completes (since the actual upload is deferred until txSignature arrives).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Dos problemas relacionados en el flujo de evidencia del técnico:
Sin feedback visual para PDFs: EvidenceUploader solo mostraba preview/nombre para imágenes. Un PDF seleccionado quedaba correctamente guardado en estado, pero la UI no lo reflejaba, parecía que no había pasado nada.
Race condition silenciosa: tras completar un mantenimiento, el refresh automático de "Available Jobs" reasignaba
selectedJobIdal siguiente job disponible, y un efecto separado limpiabacompleteSigen cualquier cambio deselectedJobId— incluyendo ese cambio automático. Esto borraba la firma de transacción antes de que el upload de evidencia pudiera dispararse, sin ningún error visible.Changes
EvidenceUploader.tsx/translations.ts: feedback visual (ícono + nombre) para cualquier archivo válido, no solo imágenes; nuevo texto aclarando que la subida ocurre al completar el mantenimiento.TechnicianDashboard.tsx: refautoSelectedJobque distingue un cambio de job automático (por refresh) de uno manual del usuario. Solo el cambio manual limpiacompleteSig.Testing
tsc --noEmit: sin errores.maintenance_eventscontx_signature,evidence_urlyevidence_hashreales.