Skip to content

Conversation

@parfeon
Copy link
Contributor

@parfeon parfeon commented Mar 17, 2025

feat(shared-worker): early request terminate on pagehide

On pagehide without bfcache client on page will send terminate to Shared Worker for early long-poll request termination and leave request sending (if configured).

fix(presence): fix channels and groups update in Shared worker

Fix an issue with the client's state update in Shared Worker caused by -pnpres suffixed entries being removed from heartbeat / leave request channels and groups.

On `pagehide` without `bfcache` client on page will send `terminate` to Shared Worker for early
long-poll request termination and `leave` request sending (if configured).

fix(presence): fix channels and groups update in Shared worker

Fix an issue with the client's state update in Shared Worker caused by `-pnpres` suffixed entries
being removed from heartbeat / leave request channels and groups.
@parfeon parfeon added status: done This issue is considered resolved. priority: high This PR should be reviewed ASAP. type: fix This PR contains fixes to existing features. labels Mar 17, 2025
@parfeon parfeon self-assigned this Mar 17, 2025
pingTimeouts[event.subscriptionKey] = setTimeout(
pingTimeouts[subscriptionKey] = setTimeout(
() => pingClients(subscriptionKey),
interval * 500 - 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be configurable ? Just like we allow heartbeat timing configuration on the top of presence interval value. Or it doesn't matter!!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mohitpubnub interval value or what exactly?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, should it be configurable or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it..subscriptionWorkerOfflineClientsCheckInterval should work for it.

Copy link
Contributor

@mohitpubnub mohitpubnub left a comment

Choose a reason for hiding this comment

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

👍🏻

@parfeon
Copy link
Contributor Author

parfeon commented Mar 19, 2025

@pubnub-release-bot release

@parfeon parfeon merged commit 36e0ec3 into master Mar 19, 2025
6 of 7 checks passed
@parfeon parfeon deleted the fix/shared-worker-presence branch March 19, 2025 11:20
@pubnub-release-bot
Copy link
Contributor

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high This PR should be reviewed ASAP. status: done This issue is considered resolved. type: fix This PR contains fixes to existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants