Open kongweiying2 opened 4 months ago
running into the same issue where the warning is unnecessarily emitted. in our case the token is just a hardcoded string that never changes.
const newProvider = new HocuspocusProvider({
url: "wss://<url>/collaboration",
name: docName,
token: "sometoken",
connect: true,
});
running into the same issue where the warning is unnecessarily emitted. in our case the token is just a hardcoded string that never changes.
const newProvider = new HocuspocusProvider({ url: "wss://<url>/collaboration", name: docName, token: "sometoken", connect: true, });
Are you saying that you're able to successfully connect, but the warning is still emitted?
yup, connection is successful but warning is still emitted
yes, I'm running into the same problem as well
For what is worth, I had this same warning message happening sometimes and it confused me. In my case, it was because the WebSocket provider (HocuspocusProviderWebsocket) was disconnected (due to nginx timeout) when trying to create the main provider connection (HocuspocusProvider) with it as parameter (websocketProvider).
Instead of telling that the WebSocket provider (HocuspocusProviderWebsocket) was simply disconnected, it threw this warning.
So it seems this warning message is triggered for the wrong reasons in some cases.
after I destroy the provide, about 5 seconds, it will be emited. It caused by disconnect? or destory? how can i avoid it?
I encountered a similar issue.
const token = JSON.stringify({
personId: personId,
});
const websocketProvider = new HocuspocusProviderWebsocket({
url: 'url',
WebSocketPolyfill: WebSocket,
});
provider = new HocuspocusProvider({
websocketProvider,
name: request.EntityId!,
token,
document,
broadcast: false,
});
Description Despite following the documentation about how to generate a JWT and set up the TipTapCollabProvider here precisely, the connection to the Cloud Collab service fails. It appears that a token is actually provided, contrary to the warning message.
Steps to reproduce the bug Steps to reproduce the behaviour:
[HocuspocusProvider] An authentication token is required, but you didn’t send one. Try adding a
tokento your HocuspocusProvider configuration. Won’t try again.
Expected behavior I expect my documents to successfully connect to TipTap Cloud and sync successfully.
Environment?
Additional context We had a lengthy discussion about this in the past in this Discord thread. I've resolved the race condition by using useEffect and reacting to the jwt state variable changing, but this doesn't resolve the issue.
https://discord.com/channels/818568566479257641/1141836806774599781/1145940143618936882
You can ignore the dummy data provided to the provider initially and the errors this causes. The presence of this shouldn't really be causing this main issue.
Thanks in advance for your great work with TipTap!