Skip to content

Conversation

@mohitpubnub
Copy link
Contributor

@mohitpubnub mohitpubnub commented Jul 8, 2025

Configuration to execute shared-worker tests in headless browser environment.

Tests to confirm subscription behavior in pubnub with shared worker.

Mohit Tejani added 2 commits July 8, 2025 00:00
added tests with edge cases for subscribe/unsubscribe with sharedworker
@pubnub-ops-terraform
Copy link

pubnub-ops-terraform commented Jul 8, 2025

🎉 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)

@mohitpubnub mohitpubnub self-assigned this Jul 8, 2025
@mohitpubnub mohitpubnub added status: in progress This issue is being worked on. priority: high This PR should be reviewed ASAP. type: test This PR contains new tests for existing functionality or fixes to existing tests. labels Jul 8, 2025
… distribution in scenario where messages arrive in one of the aggregated channel entities
Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

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

Mostly looks good. Just a few comments which maybe will give some ideas for improvement in other test cases in this suite.

Mohit Tejani added 3 commits July 8, 2025 15:49
…hange behaviour in share worker active subscription
…on change, added new test to verify resubscribing to same channel with message reecive check
@mohitpubnub mohitpubnub changed the title Test/shared worker test: subscription/presence behavior with shared-worker Jul 8, 2025
@mohitpubnub mohitpubnub marked this pull request as ready for review July 8, 2025 11:23
@mohitpubnub mohitpubnub requested a review from seba-aln as a code owner July 8, 2025 11:23
Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

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

LGTM!

@mohitpubnub mohitpubnub merged commit 09a5d19 into fix/subscribe-aggregate-heartbeats-feedback Jul 10, 2025
11 of 13 checks passed
@mohitpubnub mohitpubnub deleted the test/shared-worker branch July 10, 2025 06:37
mohitpubnub added a commit that referenced this pull request Jul 11, 2025
* 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.

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).

* feat(shared-worker): emit heartbeat processing status

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.

* 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
`unsubscribe` with the legacy interface wasn't able to complete the unsubscribe process.

* refactor(shared-worker): move some logs before request sending

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.

* refactor(shared-worker): announce request sending logs to interested 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`).

* test: subscription/presence behavior with shared-worker (#463)

* 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>

* refactor(shared-worker): incorporate server threshold into heartbeat 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).

* fix(shared-worker): fix issue which prevented catchup

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.

* refactor(shared-worker): re-adjust "backup" timer on early heartbeat

Re-adjust "backup" heartbeat timer when one of the clients request sent too early after previous
request.

* PubNub SDK v9.8.0 release.

---------

Co-authored-by: Mohit Tejani <60129002+mohitpubnub@users.noreply.github.com>
Co-authored-by: Mohit Tejani <mohit.tejani@Mohits-MacBook-Pro.local>
Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
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: in progress This issue is being worked on. type: test This PR contains new tests for existing functionality or fixes to existing tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants