basquetWi + New ticket
pluto PLUTO-472

Cache /informes filter-option lists (year-stable roster) via Next.js time-based revalidate

Done low cpcoder-pluto-cc

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 6w ago
  • wi-cli-venus note · 6w ago
    Follow-up to PLUTO-471 (/informes pool exhaustion). Elazar-requested: cache the filter-option dropdown lists that fire DB queries every /informes load and drain the max-2 pool. Incident evidence: option-list slow-queries adjuntos ~203 rows(2390ms), comisiones ~6 rows via vComisiones(2418ms), jefes. Roster is academic-year-stable (changes ~once/year). Elazar scope decision: 'good, not bulletproof' - plain TIME-BASED revalidate (~24h), NO per-mutation invalidation, self-heal on TTL acceptable. Assigned coder-pluto-cc. Path open: investigate whether options are already client-loaded-once (pluto-commons UI Interaction pattern) vs re-fetched server-side per navigation - real fix may be a missing load-once pattern, else Next unstable_cache/route revalidate ~86400s. Keep in coder lane, NO materialized view/DB change without flagging PM (would pull in db + pre-apply gate). Post-push audit only (perf on data path, not auth/schema/email). This attacks the pool-pressure root; 471's 4s timeout only bounds blast radius.
  • wi-cli-venus note · 6w ago
    SHIPPED + audit PASS:3ac9222 (v1.97.14). getComisionesForReport + getInformesFilterOptions wrapped in Next unstable_cache revalidate 86400s; option lists now ~1 DB hit/periodo/24h instead of every /informes load = pool-pressure root relieved (complements 471's 4s blast-radius bound). Client-side cascade already in place (PLUTO-468) so no per-filter server round-trip. Audit adversarially verified: (#1) NO cache-key viewer-scoping leak - both fns are pure param SELECTs on vComisiones/vInformesFilterOptions, no RLS/session-GUC/user-id read; only viewer-varying input is adjuntoId=(in-scope?user.id:null), already in the key; per-user narrowing runs downstream in page.tsx OUTSIDE the cache. (#2) staleness cannot widen containment - cached list feeds a DEMO-DATA display filter for global users, NOT the load-bearing authz clamp (jtpIds/teacherScope, uncached); worst 24h-lag under-includes, never widens. (#3) keys independent of rapid-nav ?comision/?jtp/?adjunto params -> collapses to ~1 entry across the nav storm. (#4) no /practicas + /alumnos regression. Standard PTD green (READY, sha match, 0 error/fatal, 1.97.14 live). NON-BLOCKING nit for future: getComisionesForReport's jtpIds array arg is order-sensitive in the JSON-serialized cache key - moot now (always null from all 3 call sites), but a future array-passing caller would get order-dependent cache MISSES (perf only, never a leak) - sort before keying if that caller ever appears.
  • wi-cli-venus completed · 6w ago
    Option-list Next.js cache shipped (v1.97.14, SHA 3ac9222), audit PASS - no cache-key leak, effective under rapid-nav, no 3-route regression. Pool-pressure root relieved.
chore
6w ago by wi-cli-venus
6w ago
2026-07-02 18:48