-
Notifications
You must be signed in to change notification settings - Fork 401
Fix rapid subscribe aggregate #461
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
Fix rapid subscribe aggregate #461
Conversation
Fix the issue because of which rapid subscription (from other PubNub clients in response to received subscribe response) throttling causes delayed channel list change. refactor(shared-worker): add output of requests processed by the `SharedWorker` Modify the `log` payload for `SharedWorker` to make it possible to log sent / received requests information to the main browser window (not to the SharedWorker console).
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Depending on client configuration, it will emit `status` for heartbeat, which has been started by the `SharedWorker` backup heartbeat timer mechanism. feat(shared-worker): stop `backup` heartbeats on 403 Stop heartbeats until the auth key / access token is changed. On change, `SharedWorker` will send an immediate heartbeat request. refactor(shared-worker): restart `backup` heartbeat on explicit heartbeat Restart the timer of the backup heartbeat if an explicit heartbeat request has been received from the main PubNub client.
| * | ||
| * @default `true` | ||
| */ | ||
| announceFailedHeartbeats: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will help to get more feedback on hb
👍🏻
|
Looks fine so far. |
Fix the issue with the global subscription set (used for legacy interface support) because of which `unsubscribe` with the legacy interface wasn't able to complete the unsubscribe process.
To avoid confusion in the logs reading where the message about sending the request appears earlier than it should, move the log output before sending the request.
…clients Make sure that more clients will receive log messages about request sending (we're limited to a single client for heartbeat requests). refactor(shared-worker): change log message when heartbeat impossible for presence-only channels Change the misleading console message for heartbeat requests, which are scheduled for presence-only (`-pnpres`).
* added karma configuration for sharedworker tests with headless browser, added tests with edge cases for subscribe/unsubscribe with sharedworker * fix: shared worker tests to adapt quick subscription aggregation handling compatible behaviour * test: shared worker subscription aggregation and isolation in message distribution in scenario where messages arrive in one of the aggregated channel entities * test(shared-worker): added test for token management, to test token change behaviour in share worker active subscription * test(shared-worker): added message verification to confirm subscription change, added new test to verify resubscribing to same channel with message reecive check * test(shared-worker): test cleanup, removed debug logs * test(shared-worker) confirm auth token changes through middleware generated request url * test: added test to inspect presence behaviour mimicking tab close activities --------- Co-authored-by: Mohit Tejani <mohit.tejani@Mohits-MacBook-Pro.local>
…filter Incorporate a 3-second threshold from the server to the logic that is used to skip heartbeat requests if it has been sent too soon (because the previous one was not so long ago).
…com:pubnub/javascript into fix/subscribe-aggregate-heartbeats-feedback
| // Check whether it is too soon to send request or not. | ||
| const leeway = minimumHeartbeatInterval * 0.05 * 1000; | ||
|
|
||
| if (minimumHeartbeatInterval - leeway <= 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Fix the condition that, in some cases (burst subscribe from registered clients) incorrectly identified when the initial subscribe REST API response should be patched with catch timetoken.
Re-adjust "backup" heartbeat timer when one of the clients request sent too early after previous request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in non EE also now
| // than 3 seconds which derived from the server's threshold. | ||
| // Leeway can't be applied if actual interval between heartbeat requests is smaller | ||
| // than 3 seconds which derived from the server's threshold. | ||
| if (minimumHeartbeatInterval - leeway <= 3 || expectedTimestamp - currentTimestamp > leeway) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
|
@pubnub-release-bot release |
|
🚀 Release successfully completed 🚀 |
fix(subscription-set): fix issue with global subscription set
Fix the issue with the global subscription set (used for legacy interface support) because of which
unsubscribewith the legacy interface wasn't able to complete the unsubscribe process.fix(shared-worker): fix rapid subscribe aggregate
Fix the issue because of which rapid subscription (from other PubNub clients in response to received subscribe response) throttling causes delayed channel list change.
feat(shared-worker): emit heartbeat processing status
Depending on client configuration, it will emit
statusfor heartbeat, which has been started by theSharedWorkerbackup heartbeat timer mechanism.feat(shared-worker): stop
backupheartbeats on 403Stop heartbeats until the auth key / access token is changed. On change,
SharedWorkerwill send an immediate heartbeat request.refactor(shared-worker): restart
backupheartbeat on explicit heartbeatRestart the timer of the backup heartbeat if an explicit heartbeat request has been received from the main PubNub client.
refactor(shared-worker): add output of requests processed by the
SharedWorkerModify the
logpayload forSharedWorkerto make it possible to log sent / received requests information to the main browser window (not to theSharedWorkerconsole).