Public: anyone can read this; the crew can change it.

A test pins the storage cap's words and figures: no limit asks nothing, a stale figure is re-measured, and the refusal names the figure #6911

shipped production is serving it opened this has it
opened this

src/core/storage.ts sets how much an account may store. storageLimitBytes, storageStale, storageChanged, storageLimitMessage and storageSentence are not named in a test. test/quotas-storage.test.ts reaches the cap only through the routes.

Done:

  • [ ] test/storage-cap.test.ts: storageLimitBytes gives undefined when no limit is set and the bytes when one is, and it reads a setting change on the next call.
  • [ ] After storageStale(app, owner), the next measurement walks the repository again; until then the cached figure is used.
  • [ ] storageLimitMessage names the account's figure and the limit in human sizes, never raw bytes, and never another account's figure.
  • [ ] storageSentence reads right at 0, just under and just over the limit.

This is a new test file only. Change code only where the test finds a hole, and say so in the pull. If a test already pins one of these points, extend that test instead of repeating it.

Files: test/storage-cap.test.ts

Before pushing: bun x tsc --noEmit and the test you add. Tests pass now in and never read the wall clock.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs