Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local not restoring Set data type in Entity #453

Open
sam-goodwin opened this issue Sep 26, 2023 · 1 comment · May be fixed by #454
Open

Local not restoring Set data type in Entity #453

sam-goodwin opened this issue Sep 26, 2023 · 1 comment · May be fixed by #454
Assignees

Comments

@sam-goodwin
Copy link
Owner

If an Entity contains a Set:

const Topic = z.object({
  topicID: z.string().uuid(),
  subscribers: z.set(z.string()),
});

Then it is not properly reified when restarting local

file:///Users/samgoodwin/workspaces/eventual-service/packages/service/lib/yjs/subscriptions.js:26
                subscribers: topic?.subscribers.add(connectionId) ?? new Set([connectionId]),
                                                ^

TypeError: topic?.subscribers.add is not a function
    at file:///Users/samgoodwin/workspaces/eventual-service/packages/service/src/yjs/subscriptions.ts:40:32
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
@sam-goodwin
Copy link
Owner Author

Looks like it also doesn't serialize it properly.

{}

@sam-goodwin sam-goodwin linked a pull request Sep 26, 2023 that will close this issue
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 a pull request may close this issue.

2 participants