Skip to content

Conversation

@parfeon
Copy link
Contributor

@parfeon parfeon commented Mar 6, 2025

feat(heartbeat): add ability to opt-out smart heartbeat

Add useSmartHeartbeat configuration option which allows ignoring implicit heartbeat (with successful subscribe response) and keep sending heartbeat calls with fixed intervals.

feat(shared-worker): configurable offline detection interval

subscriptionWorkerOfflineClientsCheckInterval configuration option can be used to configure the interval at which “offline” PubNub clients (when tab closed) detection will be done.

feat(shared-worker): configurable unsubscribe for offline clients

subscriptionWorkerUnsubscribeOfflineClients configuration option can be used to force unsubscribe
(presence leave) for “offline” PubNub clients (when tab closed).

refactor(shared-worker): debug output on request completion

When subscriptionWorkerLogVerbosity is set, there will be additional output to the page console
with information about which clients will be notified about request completion.

Add `useSmartHeartbeat` configuration option which allows ignoring implicit heartbeat (with
successful subscribe response) and keep sending `heartbeat` calls with fixed intervals.

feat(shared-worker): configurable offline detection interval

`subscriptionWorkerOfflineClientsCheckInterval` configuration option can be used to configure
the interval at which “offline” PubNub clients (when tab closed) detection will be done.

feat(shared-worker): configurable unsubscribe for offline clients

`subscriptionWorkerUnsubscribeOfflineClients` configuration option can be used to force unsubscribe
 (presence leave) for “offline” PubNub clients (when tab closed).

 refactor(shared-worker): debug output on request completion

 When `subscriptionWorkerLogVerbosity` is set, there will be additional output to the page console
 with information about which clients will be notified about request completion.
@parfeon parfeon added status: done This issue is considered resolved. priority: high This PR should be reviewed ASAP. type: feature This PR contains new feature. labels Mar 6, 2025
@parfeon parfeon self-assigned this Mar 6, 2025
return true;
} catch (error) {}
} catch (error) {
if (client.workerLogVerbosity) console.error(`[SharedWorker] Unable send message using message port: ${error}`);
Copy link
Contributor

@mohitpubnub mohitpubnub Mar 6, 2025

Choose a reason for hiding this comment

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

nitpicking may be. Is it typo in log message for message port instead messagepost?

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 no, it is the way how I wrote MessagePort type. I don't think that it is that bad in this form :)

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.

so far LGTM

@parfeon
Copy link
Contributor Author

parfeon commented Mar 6, 2025

@pubnub-release-bot release

@parfeon parfeon merged commit 0cbe409 into master Mar 6, 2025
6 of 7 checks passed
@parfeon parfeon deleted the refactor/shared-worker branch March 6, 2025 08:58
@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: feature This PR contains new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants