Skip to content

docs: add offline collection guide and example - #21

Open
dhruvxvaishnav wants to merge 1 commit into
supabase:mainfrom
dhruvxvaishnav:feat/offline-support
Open

dhruvxvaishnav wants to merge 1 commit into
supabase:mainfrom
dhruvxvaishnav:feat/offline-support

Conversation

@dhruvxvaishnav

Copy link
Copy Markdown

Closes #10

Summary

  • Document how the current Supabase collection adapter composes with compatible browser SQLite persistence and offline transaction packages.
  • Add a browser-only todos example that keeps the collection cache in OPFS SQLite and queues insert, update, and delete actions for PostgREST replay.
  • Explain Auth/RLS behavior, retry and idempotency limits, Realtime recovery, conflicts, and multi-tab leadership. No adapter source changes were needed for this experiment.

Validation

  • pnpm exec vitest run --project unit tests/offline-example.test.ts: 5 passed.
  • pnpm test: 272 passed, 4 todo.
  • pnpm typecheck: passed.
  • pnpm build: passed.
  • pnpm test:e2e in WSL with local Supabase: 48 passed.
  • pnpm check on a Linux copy with LF line endings: passed with four pre-existing suppression warnings in src/db.ts. The Windows checkout check reported 39 formatting errors from CRLF line endings in unchanged files.
  • Browser smoke test on localhost: offline insert, update, and delete each survived a reload; reconnect replay sent POST, PATCH, then DELETE against mocked PostgREST responses and drained the outbox. This did not exercise a live server's Auth, RLS, Realtime, or conflict behavior.
  • git diff --check: passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate offline support with TanStack SQLite persistence and offline transactions

1 participant