Repository navigation
Disk-full evidence for store, auth and audit; the auth mount answers 503 when Better Auth fails on storage - #968
Merged
Merged
Conversation
# Conflicts: # docs/RUNTIME-IMPLEMENTATION.md # packages/auth/CHANGELOG.md
…3 on a storage failure (#902) A deterministic every-OS test caps store.sqlite, audit.sqlite and auth.sqlite in turn with PRAGMA max_page_count plus a filler table, and a Linux CI step fills a 16 MiB tmpfs under a real urlcode serve. Both check documented refusals, no partial writes, recovery once space frees, and integrity_check. Found: a sign-in whose session could not be stored answered Better Auth's bare 500 (full disk) or core's 500 (a throw on a lock timeout). The auth mount now answers 503 auth_unavailable with Retry-After: 1 and no Set-Cookie. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 20:13
# Conflicts: # docs/RUNTIME-IMPLEMENTATION.md # packages/auth/CHANGELOG.md
…902) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-full test (#902) The static job type-checks before any add-on is built; test/disk-full.test.ts imports the store's source, whose audit type imports resolved to an unbuilt dist. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # docs/STORE.md # scripts/package-audit.ts
# Conflicts: # scripts/package-audit.ts
# Conflicts: # docs/RUNTIME-IMPLEMENTATION.md
This was referenced Sep 29, 2026
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.
Part of #902: this is the disk-full evidence for item 4.
What changed
test/disk-full.test.tsis deterministic and part ofnpm test, so it runs on every OS. It serves one site that composes audit, auth and store, then fills each database in turn. To fill one, it caps every connection to the file at its current page count withPRAGMA max_page_count. That setting is per connection, so the test captures each extension's own connection. A filler table then takes the remaining free pages. The test covers:record(), and audited store writes.test/disk-full.integration.ts(npm run test:disk-full) starts a realurlcode servewith its data directory on a filesystem of at most 64 MiB. It fills that filesystem toENOSPCwith a filler file, then removes it.multiprocessjob now mounts a 16 MiB tmpfs withsudoand runs the integration test.test/ci-workflow.test.tsasserts the new steps.500on a full disk, or core's500when a lock timeout made the handler throw. The mount now answers503 {"error":"auth_unavailable"}withRetry-After: 1and noSet-Cookie.packages/auth/test/auth.test.tsadds a regression test using a held lock.RIM-STORE-PERSIST-001, CI.md, EXTENSIONS.md, and the auth README, SECURITY and CHANGELOG.Evidence
Each test checks that every write answers a documented refusal or commits whole:
503 storage_unavailable. The rows, theIdempotency-Keyclaims, the host transaction results and the balance sum match the committed answers exactly.record()answers503 audit_unavailable, and a refused batch stores none of its events. Store events wait in the outbox.503 auth_unavailableand stores no session. A signed-in route answers 200, never a false 401.After recovery:
PRAGMA integrity_checkis ok on all three files.Local runs on macOS, Node 26:
npm run verify: green.npm run test:package: green.disk-full.test.ts: three runs, all identical and passing.disk-full.integration.tson a 16 MiB HFS+ disk image (hdiutil, no root): passed twice.The Linux tmpfs run is this PR's CI.
Limits
These tests do not prove:
audit_backlogon a full disk.max_page_countcaps the database file but not its-walor-shm; only the filesystem run fills those. Neither test is a soak test.🤖 Generated with Claude Code