Skip to content

Conversation

@cngonzalez
Copy link
Member

@cngonzalez cngonzalez commented Feb 6, 2026

Description

Presence as it's implemented in the SDK right now doesn't seem to work for Canvas or Media Library (we get a Websocket error) but we still need to move it to source for architectural reasons. This PR does that.

What to review

  • The updated presenceStore.ts implementation which now validates source types
  • The modified usePresence hook that accepts source options and validates them
  • Test coverage for both supported and unsupported source types
  • Error messages that provide clear guidance when using unsupported sources

Testing

Added comprehensive tests for:

  • Validating that dataset sources work correctly
  • Ensuring appropriate error messages when using media library sources
  • Ensuring appropriate error messages when using canvas sources
  • Verifying existing functionality continues to work with the new parameter structure

FIXES SDK-760

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sdk-docs Ready Ready Preview, Comment Feb 6, 2026 4:50pm
sdk-kitchensink-react Ready Ready Preview, Comment Feb 6, 2026 4:50pm

Request Review

Copy link
Member Author

cngonzalez commented Feb 6, 2026

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 95.41% (🎯 95%) 7849 / 8226
🟢 Statements 95.41% (🎯 95%) 7849 / 8226
🟢 Functions 95.96% (🎯 95%) 381 / 397
🟢 Branches 93.02% (🎯 90%) 2319 / 2493
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/presence/presenceStore.ts 98.08% 94.73% 100% 98.08% 159, 167-168
packages/core/src/store/createActionBinder.ts 97.95% 97.56% 100% 97.95% 252-253
packages/react/src/hooks/presence/usePresence.ts 100% 90% 100% 100%
Generated in workflow #2927 for commit 6c8d1bf by the Vitest Coverage Report Action

@cngonzalez cngonzalez force-pushed the 02-06-refactor_presence_convert_presence_to_use_source branch from dbc5509 to 8bbde5b Compare February 6, 2026 15:56
@cngonzalez cngonzalez force-pushed the 02-06-refactor_presence_convert_presence_to_use_source branch from 8bbde5b to 6726b25 Compare February 6, 2026 16:00
@cngonzalez cngonzalez marked this pull request as ready for review February 6, 2026 16:05
@cngonzalez cngonzalez requested a review from a team as a code owner February 6, 2026 16:05
@cngonzalez cngonzalez requested review from rexxars and removed request for a team February 6, 2026 16:05
@cngonzalez cngonzalez force-pushed the 02-05-refactor_localize_not_using_resource_on_client_to_the_client_store branch from c6a1b4c to 7474e0d Compare February 6, 2026 16:48
Copy link
Contributor

@laurenashpole laurenashpole left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants