test(conformance): parametrize how adapters surface query errors#1639
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds an optional ChangesError surface conformance support
Estimated code review effort: 1 (Trivial) | ~5 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
More templates
@tanstack/angular-db
@tanstack/browser-db-sqlite-persistence
@tanstack/capacitor-db-sqlite-persistence
@tanstack/cloudflare-durable-objects-db-sqlite-persistence
@tanstack/db
@tanstack/db-ivm
@tanstack/db-sqlite-persistence-core
@tanstack/electric-db-collection
@tanstack/electron-db-sqlite-persistence
@tanstack/expo-db-sqlite-persistence
@tanstack/node-db-sqlite-persistence
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/react-native-db-sqlite-persistence
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/tauri-db-sqlite-persistence
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 125 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 4.26 kB ℹ️ View Unchanged
|
0ad8472 to
70b5989
Compare
Solid surfaces query errors by throwing (CollectionStateError) on read, for an
<ErrorBoundary> to catch, rather than exposing a readable isError flag like
React/Vue/Svelte/Angular. That's a framework idiom, not a bug — so instead of
forcing Solid into the flag model, parametrize the error-status scenario.
Adds driver.errorSurface ('flag' | 'throw', default 'flag'). The error-status
scenario asserts a readable isError/status for 'flag', and that reading the
errored result throws for 'throw'. Solid declares 'throw' and clears its
error-status knownGap; the other four keep the default flag assertions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70b5989 to
c984572
Compare
Follow-up #3 of 3 to the conformance suite (#1636), resolving the Solid
error-statusknownGap.Base: stacked on
test/live-query-conformance-suite(#1636). Re-target tomainonce #1636 lands.Not a bug — a legitimate framework difference
Unlike the Svelte (#1637) and Angular (#1638) follow-ups, this one isn't an adapter fix. The suite flagged that Solid surfaces query errors differently: it routes them through
createResource/Suspense, so reading an errored query throwsCollectionStateError(for an<ErrorBoundary>to catch) rather than exposing a readableisError/status === 'error'flag like React/Vue/Svelte/Angular.That's idiomatic Solid, not something to "fix." So instead of forcing Solid into the flag model, the suite is parametrized to assert whichever model an adapter declares.
Confirmed behavior (probe): the errored collection reaches
errorstatus, mount does not throw, and reading the result throwsCollection is in error state.Change
contract.ts: adddriver.errorSurface?: 'flag' | 'throw'(defaultflag).suite.ts: theerror-statusscenario now asserts:flag→isError === true/status === 'error'(readable), orthrow→ reading the errored result throws (boundary model).solid-dbdriver: declareserrorSurface: 'throw', clears itserror-statusknownGap.flagassertions unchanged.Verification
All five conformance suites pass 24/24. Solid's
error-statusnow passes via the boundary branch; the other four via the flag branch. Test-infra only — no published-package changes, so no changeset.🤖 Generated with Claude Code
Summary by CodeRabbit