Skip to content

docs: update multi-tab behavior for web SDK (powersync-docs #552) - #66

Merged
michaelbarnes merged 3 commits into
mainfrom
drift/docs-552-multi-tab-shared-workers
Sep 14, 2026
Merged

michaelbarnes merged 3 commits into
mainfrom
drift/docs-552-multi-tab-shared-workers

Conversation

@bean1352

@bean1352 bean1352 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Generated by Claude. Review carefully before merging.

Source docs PR: powersync-ja/powersync-docs#552

What changed in docs

The multi-tab support section in the JavaScript Web SDK reference was rewritten. The enableMultiTabs flag now defaults to false on Android, iOS, and Safari (not just true everywhere), and a new "Behavior Without Shared Workers" section documents the broadcast channel fallback introduced in v2.1.0.

Skill updates in this PR

  • skills/powersync/references/sdks/powersync-js.md: Updated the enableMultiTabs code comment to note the platform-specific default, and rewrote the multi-tab behavior description to cover the broadcast channel fallback when shared workers are disabled or unavailable.

Notes for reviewer

The previous description said "only the oldest tab syncs" when multi-tab is disabled, which is no longer accurate since v2.1.0 added broadcast channels for sharing sync status, watched query update notifications, and sync stream subscriptions across tabs. The updated text covers both paths: shared-worker (enabled) and broadcast fallback (disabled/unavailable).

No changes to other skill files were needed. The AGENTS.md install section still lists @journeyapps/wa-sqlite@latest as a peer dependency, but its removal as a peer dependency (as of v2.1.0) came from a separate docs PR (#550) and is out of scope for this PR.


Generated by Claude Code

- enableMultiTabs defaults to false on Android, iOS, and Safari
- When multi-tab is disabled/unavailable, broadcast channels (v2.1.0+)
  share sync status, update notifications, and stream subscriptions
- Remove inaccurate "only oldest tab syncs" description

Source: powersync-docs#552
@bean1352
bean1352 requested a review from michaelbarnes August 4, 2026 12:51
@bean1352 bean1352 self-assigned this Aug 4, 2026

@michaelbarnes michaelbarnes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bean1352 could you check if these changes still valid seeing that the flags got folded up?

…Factory

The flags object was removed from the SDK. useWebWorker and enableMultiTabs
are now properties of the database config object, not flags. WASQLiteOpenFactory
is no longer needed — vfs is passed directly in database. Remove debugMode
reference (no longer in the SDK).

Addresses review comment on PR #66.

Copy link
Copy Markdown
Collaborator Author

Good catch. The flags object was removed from the SDK — useWebWorker and enableMultiTabs are now properties of the database config object, not a top-level flags block. The skill file carried those stale examples forward unchanged from the original.

Fixed in the latest commit:

  • Removed the flags: { ... } block from the Web-Specific Options example; moved useWebWorker and enableMultiTabs into database.
  • Removed debugMode: true (no longer in the SDK docs) and replaced the Chrome DevTools logging section with the current databaseWorkerLogLevel / sync.logLevel approach.
  • Updated the VFS example to drop WASQLiteOpenFactoryvfs is now passed directly inside database, matching current docs.
  • Updated the Safari note to reference database.useWebWorker: false instead of the old flags path.

The core behavioral content (multi-tab platform defaults, broadcast channel fallback) from this PR is still accurate.


Generated by Claude Code

@michaelbarnes michaelbarnes changed the title Sync from docs: update multi-tab behavior for web SDK (powersync-docs #552) docs: update multi-tab behavior for web SDK (powersync-docs #552) Sep 9, 2026
@michaelbarnes
michaelbarnes merged commit 60255f8 into main Sep 14, 2026
1 check passed
@michaelbarnes
michaelbarnes deleted the drift/docs-552-multi-tab-shared-workers branch September 14, 2026 18:32
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.

3 participants