Repository navigation
Conversation
…tock 422 The stock per warehouse that the manual order wizard and the order edition show is cached for five minutes. When another sale or a webhook took those units, confirming the order or saving the edition answered 422 for lack of stock, but nothing refreshed that cache: the wizard kept marking the same warehouse as covering the whole order, the edition warned of no shortfall, and retrying failed the same way until the cache expired. Both mutations now invalidate the inventory queries when the API refuses them with a 422, so the screen shows the real stock before the next try. Other failures leave the cache alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Revisado. No lo mergearía para esta entrega. El diagnóstico está bien: el stock por depósito se cachea cinco minutos, y si otra venta o un webhook se llevan esas unidades, confirmar la orden o guardar la modificación responde 422 «Insufficient stock» sin que nada refresque esa caché. Es molesto, pero hace falta que el stock se mueva por otro lado mientras el operador está en el formulario, y el sistema no queda mal: el 422 es correcto y la orden no se crea. El usuario puede recargar. Lo agruparía con #70, #71 y #75 en una sola card de pulido para después de la entrega. |
This was referenced Oct 3, 2026
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.
Ticket de Jira
https://proyectofinalfrlp.atlassian.net/browse/TESIS-999029
Descripción
El stock por depósito que muestran el alta manual (paso 2) y la modificación de órdenes queda cinco minutos en caché. Si otra venta o un webhook se llevan esas unidades, confirmar la orden o guardar la modificación responde 422 «Insufficient stock», pero nada refrescaba esa caché:
useConfirmDraftOrderno invalidaba nada cuando la orden no había llegado a crearse.useUpdateOrdersólo invalidaba enonSuccess.Resultado: el paso 2 seguía marcando el mismo depósito como «cubre todo», la edición no avisaba ningún faltante, y reintentar fallaba de la misma forma hasta que vencía la caché.
useConfirmDraftOrderinvalida['inventory']cuando la orden no se creó y el rechazo es un 422.useUpdateOrdersuma unonErrorque invalida['inventory']con un 422.Evidencia visual
N/A
Cómo probar
mastersigue apareciendo durante cinco minutos.Verificación:
npm run test,npm run lint,npm run format:checkynpm run buildlimpios.Impacto y consideraciones
¿Introduce breaking changes?
No
¿Requiere nuevas variables de entorno?
No
¿Afecta la arquitectura o genera un nuevo patrón?
No
Conflicto esperable con proyecto-web#71 (card 026): las dos ramas crean
useUpdateOrder.test.tsxy tocanuseUpdateOrder.tsen la misma mutación. Se resuelve quedándose con los cambios y los casos de las dos.🤖 Generated with Claude Code