Repository navigation
fix(pedidos): filtros multi-valor, limpiar todo consolidado y fiados sin doble filtro - #15
Merged
Merged
Conversation
…sin doble filtro - Arregla filtros multi-valor en /api/pedidos: getAll + in: [...] - Limpiar todo ahora borra search, cliente, filtros y fecha (all=true) - Tab Fiados muestra todos los fiados por defecto (all=true forzado) - Hint + botón Limpiar en FiadosTable - Fix de useShallowSearchParams para lectura sincrónica tras mutación manual - Tests E2E para regresiones
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
casasleonj
added a commit
that referenced
this pull request
Jul 17, 2026
* chore: add .auth to .gitignore for production test storageState * feat: add production portal smoke + audit e2e suite for portal.aguabambu.com * fix(realtime): make maxDuration a static literal for Next.js segment config * fix(produccion-portal): handle navigation timeouts and increase config timeout * fix(produccion-portal): dismiss PWA banner, handle mobile pedidos missing content, switch to parallel mode * fix(pedidos): timeout de 10s en usePedidos y safety net de 15s contra skeleton infinito en móvil * fix(realtime): timeout de conexión SSE 8s, fallback a polling tras 2 errores y downlink < 1.5 Mbps * fix(mobile): padding para banner PWA, touch target >=44px en indicador y >=40px en botones de acción * docs(AGENTS): documentar navegación lenta ~60s en producción como observación de infraestructura * fix(pedidos): eliminar bloque duplicado en skeleton de pedidos-client * fix(realtime,rate-limit): rate-limit configurable y respuesta rate_limited via SSE stream * fix(mobile,realtime,pedidos): banner PWA touch target, embarques overflow, saveData, limpiar timedOut y icon buttons cuadrados * fix(connectivity-indicator): no mostrar Offline cuando hay internet pero SSE no conecta * fix(clientes): timeout save 8s y reset saving explícito en timeout/offline/error * fix(realtime): schedule SSE reconnect after rate_limited; unit tests para backoff, circuit breaker y jitter * docs(env,AGENTS): variables de entorno realtime y known issue #15 resuelto * fix(realtime): maxDuration como literal estático, validación de envs rate-limit y tests de conectividad/reconnect * refactor(realtime): robustez del provider - cleanup timers, guard intendedRef, clamp retryAfter, manejo EventSource throw; tests indicador y provider * style(tests): elimina warnings ESLint en tests realtime; añade dependencia faltante en provider * test(e2e): timeout de login adaptativo 60s para ambientes remotos (Vercel Hobby cold start) * feat(qa): baseline config + testIgnore produccion + docs/qa template - Mueve e2e/produccion-portal.spec.ts a e2e/produccion/ y agrega '**/produccion/**' a testIgnore default para evitar que el runner local intente login contra producción. - Actualiza e2e/produccion.config.ts testDir para apuntar a la subcarpeta. - Ajusta import de fixtures en produccion-portal.spec.ts (../fixtures). - Agrega screenshot: 'only-on-failure' en playwright.config.ts. - Crea docs/qa/_template.md, docs/qa/findings-flag.md y docs/qa/known-red-baseline.md. - Agrega e2e/.baseline-smoke.json con 3/4 specs pasando (1 falla pre-existente en auth.spec.ts signOut). * feat(qa): fixtures-paranoid + helpers + reportBug unit tests - Crea e2e/fixtures-paranoid.ts con apiCall, assertUx (7 rules), assertNoUnexpectedConsoleErrors, expectAuditEntry, ensureSelladorUser, skipBaseCajaParanoid (3 dias), screenshotOnFail. - Extrae logica pura de reportBug a src/lib/qa-reportBug.ts para testear con Vitest. - Crea src/lib/__tests__/qa-reportBug.test.ts con 4 tests. - Crea e2e/qa/00-smoke-fixtures-paranoid.spec.ts para verificar helpers end-to-end. - No toca e2e/fixtures.ts ni seed-test.ts (0 regresion). * feat(qa): seed-large.ts para pruebas de performance - Crea prisma/seed-large.ts idempotente. - Limpia solo tablas afectadas (Cliente, Pedido, Pago, etc.) sin tocar users/productos/config. - Genera 1500 clientes + 3000 pedidos en ~2.4s via createMany. - Configurable via env CLIENTES y PEDIDOS. - Fix menor en e2e/qa/00-smoke-fixtures-paranoid.spec.ts (page no usado en beforeEach). * M2: specs RBAC y XSS findings confirmados - Agrega login helpers a e2e/fixtures-paranoid.ts - e2e/qa/02-rbac/api-rbac.spec.ts: 8 tests (5 negativos fallan, 3 positivos pasan) - e2e/qa/02-rbac/xss-link-ubicacion.spec.ts: React 19 bloquea javascript: en UI - e2e/qa/02-rbac/xss-link-ubicacion-api.spec.ts: API acepta javascript: (bug) - docs/qa/reporte-02-rbac.md: estado de findings verificados * fix(qa-02): RBAC en endpoints de lectura + validación URL linkUbicacion - Agrega requireRole a GET de: - /api/facturas/[id] (ADMIN, CONTADOR) - /api/clientes/[id] (ADMIN, ASISTENTE, CONTADOR) - /api/produccion (ADMIN) - /api/trabajadores y /api/trabajadores/[id] (ADMIN, ASISTENTE, CONTADOR) - Reemplaza z.string().url() por SafeUrlSchema (solo http/https) para Cliente.linkUbicacion, evitando stored XSS via javascript: scheme. - Todos los specs de e2e/qa/02-rbac pasan (11/11). - npm run test pasa (1983 tests). * M3: specs y fixes de validación de datos / mass assignment - Exporta SafeUrlSchema desde src/lib/validators.ts. - Restringe ClienteUpdateSchema: omite verificado, bloqueado, offlineId; agrega activo y updatedAt; strict() rechaza campos desconocidos. - Aplica SafeUrlSchema a NegocioCreateSchema.linkUbicacion. - Agrega specs en e2e/qa/03-validacion/ para mass assignment y XSS link. - Verificación: npx tsc --noEmit, npm run test (1983), M2+M3 E2E pasan. * M4-OFFLINE: dedup specs + fix POST /api/pedidos devuelve 200 + deduped en reintento offline * M5-RATE-LIMIT: limpiar código muerto, tests unitarios/E2E y reporte QA * M6-REALTIME: source audit, E2E event delivery, fix embarque test shape, relajar rate-limit en tests E2E * docs: design spec M7 offline sync unification * docs: design spec M7 offline sync unification (versión convergida) * refactor(sync): calculateBackoff acepta randomFn inyectable * test(sync): unit tests para funciones puras de retry/backoff/DLQ * refactor(offline): eliminar código muerto de syncQueue legacy * refactor(offline): queuePedidoOffline usa requestQueue en transacción * test(offline): unit tests para queuePedidoOffline * refactor(sync): mutex, timeout 60s, 401 sin purge, 429 backoff, update atómico pedido * test(sync): unit tests para syncWithServer * feat(connectivity): contador ambas colas, badge DLQ, toast solo manual * feat(repartidor): contador de pedidos pendientes + DLQ * feat(repartidor): data-testids para venta libre, sync y productos (E2E M7) * test(offline): e2e specs para sync unificado M7 * chore(offline): fix imports no usados en e2e M7 * docs(qa): reporte M7 offline sync unification
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.
Qué arregla
/pedidossolo aplicaban el primer valor.Cambios principales
api/pedidos/route.tsusasearchParams.getAll()y pasa arrays.PedidoFilter/ListarPedidosInputusanstring[]paraestadoEntrega/estadoPago/origen.PrismaPedidoRepository.buildWhereusa{ in: [...] }.PedidoFilters: nuevoonClearAllque limpia search + clienteId + 4 grupos + setea?all=true.fiados/alertasfuerzaall=trueen el fetch.FiadosTable: defaultperiodo='todos', hint cuando está restringido, botón "Limpiar" local.useShallowSearchParamspara lectura sincrónica tras mutación manual.Verificación
npx tsc --noEmit✅npx vitest run src/modules/pedidos✅ 93 testsnpx vitest run src/hooks/__tests__/use-shallow-search-params.test.ts✅ 7 testsnpx playwright test e2e/pedidos-filtros-funcionales.spec.ts --project=chromium --workers=1 --retries=1✅ 9/9Archivos
10 archivos, +282/-40 líneas.