Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Distinguish cache read failures from individual missing members
Use a read API that preserves transport errors; invalidate only buckets containing confirmed missing or corrupt members, with an atomic check against concurrent replacements.
Bad example
| 1 | const rows = await readOrEmpty(keys); if (rows.some(x => !x)) await invalidateAll(); |
Explanation (EN)
Use a read API that preserves transport errors; invalidate only buckets containing confirmed missing or corrupt members, with an atomic check against concurrent replacements.
Objašnjenje (HR)
Use a read API that preserves transport errors; invalidate only buckets containing confirmed missing or corrupt members, with an atomic check against concurrent replacements.
Good example
| 1 | try { const rows = await readStrict(keys); await invalidateAffectedMissingMembers(rows); } catch (error) { log(error); } |
Explanation (EN)
Distinguish cache read failures from individual missing members
Objašnjenje (HR)
Distinguish cache read failures from individual missing members
Notes (EN)
Use a read API that preserves transport errors; invalidate only buckets containing confirmed missing or corrupt members, with an atomic check against concurrent replacements.
Bilješke (HR)
Primijeniti pri promjenama cachea, fallbacka i obrade skupova podataka.
Exceptions / Tradeoffs (EN)
Authoritative whole-cache invalidation is appropriate only when evidence establishes global corruption.
Iznimke / Tradeoffi (HR)
Authoritative whole-cache invalidation is appropriate only when evidence establishes global corruption.