Skip to content

Commit 0beda2c

Browse files
parfeonmohitpubnubpubnub-release-bot
authored
Fix subscribe request aggregation in SharedWorker. (#403)
fix(shared-worker): fix presence leave request preparation Fix issue because of which leave request modified wrong URL path component with actual channels. fix(shared-worker): fix channels / groups list modification issues Fix issue because of which removed channels / groups didn't cancel previous subscribe request to re-subscribe with new set of channels / groups. fix(shared-worker): fix requests aggregation issues Fix issue because of which suitable active PubNub clients subscription not has been used for aggregation and caused additional connections or wrong set of channels / groups. refactor(subscription): process messages only for subscribed Pre-process entries from subscribe response to filter out updates which has been received for channels and groups which are not part of subscription loop (subscription aggregation in shared worker). refactor(package): add `types` entry for Node.js integration Point to the built-in types definition file when package used with npm / yarn. --------- Co-authored-by: Mohit Tejani <[email protected]> Co-authored-by: PubNub Release Bot <[email protected]>
1 parent bc85e1d commit 0beda2c

File tree

15 files changed

+689
-196
lines changed

15 files changed

+689
-196
lines changed

.pubnub.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
---
22
changelog:
3+
- date: 2024-09-30
4+
version: v8.2.8
5+
changes:
6+
- type: bug
7+
text: "Fix issue because of which leave request modified wrong URL path component with actual channels."
8+
- type: bug
9+
text: "Fix issue because of which removed channels / groups didn't cancel previous subscribe request to re-subscribe with new set of channels / groups."
10+
- type: bug
11+
text: "Fix issue because of which suitable active PubNub clients subscription not has been used for aggregation and caused additional connections or wrong set of channels / groups."
12+
- type: improvement
13+
text: "Pre-process entries from subscribe response to filter out updates which has been received for channels and groups which are not part of subscription loop (subscription aggregation in shared worker)."
14+
- type: improvement
15+
text: "Point to the built-in types definition file when package used with `npm` / `yarn`."
316
- date: 2024-08-01
417
version: v8.2.7
518
changes:
@@ -1023,7 +1036,7 @@ supported-platforms:
10231036
- 'Ubuntu 14.04 and up'
10241037
- 'Windows 7 and up'
10251038
version: 'Pubnub Javascript for Node'
1026-
version: '8.2.7'
1039+
version: '8.2.8'
10271040
sdks:
10281041
- full-name: PubNub Javascript SDK
10291042
short-name: Javascript
@@ -1039,7 +1052,7 @@ sdks:
10391052
- distribution-type: source
10401053
distribution-repository: GitHub release
10411054
package-name: pubnub.js
1042-
location: https://github.com/pubnub/javascript/archive/refs/tags/v8.2.7.zip
1055+
location: https://github.com/pubnub/javascript/archive/refs/tags/v8.2.8.zip
10431056
requires:
10441057
- name: 'agentkeepalive'
10451058
min-version: '3.5.2'
@@ -1710,7 +1723,7 @@ sdks:
17101723
- distribution-type: library
17111724
distribution-repository: GitHub release
17121725
package-name: pubnub.js
1713-
location: https://github.com/pubnub/javascript/releases/download/v8.2.7/pubnub.8.2.7.js
1726+
location: https://github.com/pubnub/javascript/releases/download/v8.2.8/pubnub.8.2.8.js
17141727
requires:
17151728
- name: 'agentkeepalive'
17161729
min-version: '3.5.2'

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## v8.2.8
2+
September 30 2024
3+
4+
#### Fixed
5+
- Fix issue because of which leave request modified wrong URL path component with actual channels.
6+
- Fix issue because of which removed channels / groups didn't cancel previous subscribe request to re-subscribe with new set of channels / groups.
7+
- Fix issue because of which suitable active PubNub clients subscription not has been used for aggregation and caused additional connections or wrong set of channels / groups.
8+
9+
#### Modified
10+
- Pre-process entries from subscribe response to filter out updates which has been received for channels and groups which are not part of subscription loop (subscription aggregation in shared worker).
11+
- Point to the built-in types definition file when package used with `npm` / `yarn`.
12+
113
## v8.2.7
214
August 01 2024
315

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
2828
npm install pubnub
2929
```
3030
* or download one of our builds from our CDN:
31-
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.2.7.js
32-
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.2.7.min.js
31+
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.2.8.js
32+
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.2.8.min.js
3333
3434
2. Configure your keys:
3535

dist/web/pubnub.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,7 +3816,7 @@
38163816
return base.PubNubFile;
38173817
},
38183818
get version() {
3819-
return '8.2.7';
3819+
return '8.2.8';
38203820
},
38213821
getVersion() {
38223822
return this.version;
@@ -5868,7 +5868,13 @@
58685868
if (!serviceResponse) {
58695869
throw new PubNubError('Service response error, check status for details', createValidationError('Unable to deserialize service response'));
58705870
}
5871-
const events = serviceResponse.m.map((envelope) => {
5871+
const events = serviceResponse.m
5872+
.filter((envelope) => {
5873+
const subscribable = envelope.b === undefined ? envelope.c : envelope.b;
5874+
return ((this.parameters.channels && this.parameters.channels.includes(subscribable)) ||
5875+
(this.parameters.channelGroups && this.parameters.channelGroups.includes(subscribable)));
5876+
})
5877+
.map((envelope) => {
58725878
let { e: eventType } = envelope;
58735879
// Resolve missing event type.
58745880
eventType !== null && eventType !== void 0 ? eventType : (eventType = envelope.c.endsWith('-pnpres') ? PubNubEventType.Presence : PubNubEventType.Message);

dist/web/pubnub.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)