-
Notifications
You must be signed in to change notification settings - Fork 402
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
Customize subscription time #396
Comments
Thank you for reaching out to us. |
Hey Parfeon, Subscription call hangs out in the network tab for 60s. Console then shows:
Full Output:
Chat.init({
publishKey: import.meta.env.VITE_PUBNUB_PUB_KEY,
subscribeKey: import.meta.env.VITE_PUBNUB_SUB_KEY,
userId: userId,
storeUserActivityTimestamps: true,
restore: true,
}).then((chat) => {
chat.sdk.addListener({
status: (statusEvent) => {
console.log('Status', statusEvent);
if (statusEvent.category === 'PNBadRequestCategory') {
console.error('Bad category detected');
} else if (statusEvent.operation === 'PNUnsubscribeOperation') {
console.error('unsubscribe hit, was this intentional?', statusEvent.affectedChannels);
}
},
});
}); Currently, i'm working around it on mac by just signaling into the users channel every 50 seconds so it has something preventing it from entering this state. |
That is an unexpected category. Interesting, what exactly we get from WebKit when request timeout. |
@WalrusSoup can I advise removing screenshot with web console from your response to avoid keys leakage? |
The app is built for Mac. There is no way to adjust the timeout from what I am seeing, it's hard coded for 60s from webkit. We are loading a remote url. The 60s applies to all requests unfortunately. For keys, we cycled them. So all good. |
@WalrusSoup this issue is addressed in v8.2.7 |
So it wasn't lack of feature but a bug in code because of which the subscription loop didn't act properly and stopped receiving updates. Now, even if a request will be terminated earlier, it will get proper error category and the subscription loop will restart as usual and keep waiting for real-time updates. |
Confirmed that this latest version works and the subscription loop restarts on it's own now. Terrific! Thank you! |
@WalrusSoup solution for this fix struck us from behind with a different issue inside of React Native and how it may handle network issues. Decided to contact you because I'll probably have to change the category to which this kind of error will resolve. After changes, it will be |
I'm running into an issue where a webkit webview drops connections after 60s. Pubnub, by default, listens for 280s. For periods where conversations may be idle when using the chat SDK, this causes a timeout. When interrupted, the SDK will kick up a
PNBadRequestCategory
error. If we attempt to reconnect the app starts falling apart unless we dispose of all the existing connections and re-connect to all existing channels.Is there a way to customize this period? or any thoughts on a workaround?
My current workaround is to just broadcast a dead message into the users own channel with
signal
- but was hoping for something cleaner.The text was updated successfully, but these errors were encountered: