Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
id: "1080" issue: 1080 kind: bug risk: low title: "Redis resilience: migrate remaining cache consumers (printing, ERP server files)" acceptance: - "Grep confirms no raw import of ioredis outside packages/kv/ — all consumers go through @carbon/kv" - "packages/printing/src/cache.server.ts: cache reads treat null as a miss; writes don't throw" - "apps/erp/app/modules/shared/.server.ts: Redis null returns handled as cache miss" - "apps/erp/app/modules/settings/.server.ts: Redis null returns handled as cache miss" - "apps/erp/app/modules/users/*.server.ts: Redis null returns handled as cache miss" - "apps/erp/app/routes/api+/docs.ts: Redis null returns handled as cache miss" - "TypeScript clean: pnpm --filter @carbon/printing typecheck and relevant ERP packages" - "Biome lint clean"
Context
PR #1083 (merged to main) wraps the @carbon/kv Redis client at the Proxy level via withResilience() in packages/kv/src/resilient.ts. All consumers that import redis from @carbon/kv automatically get fail-soft behavior — reads resolve null (collections []), writes resolve null, no thrown errors. The resilience is handled at the wrapper level; per-call-site try/catch for connectivity is NOT needed.
Task
Audit and harden the remaining cache consumers (non-auth, non-rate-limit):
Grep for
import.*ioredisin all app/package code outsidepackages/kv/— any such import bypasses the resilience wrapper and must be changed to useimport { redis } from "@carbon/kv"instead.For each consumer file:
packages/printing/src/cache.server.tsapps/erp/app/modules/shared/*.server.tsapps/erp/app/modules/settings/*.server.tsapps/erp/app/modules/users/*.server.tsapps/erp/app/routes/api+/docs.ts
Check: does the code assume
redis.get()returns a non-null value? If it does (e.g. JSON.parse without null guard, destructuring without null check), fix it to treatnullas a cache miss and fall through to the source of truth.Do NOT add try/catch for Redis connectivity — that's already handled by the wrapper.
Run typecheck and lint; ensure clean.
Open a PR against main. Close issue #1080 from the PR body ("Closes #1080").