Skip to content

Conversation

@parfeon
Copy link
Contributor

@parfeon parfeon commented Mar 11, 2025

fix(fetch): fix fetch error handling

Fix issue because of errors returned by fetch taken from iframe (to protect against monkey-patching by APM packages) was't handled as Error.

feat(listener): SubscriptionSet listener will receive updates from new Subscription

SubscriptionSet will re-add listener every time when Subscription or SubscriptionSet added to it - this will let receive updates from newly added subscribe capable objects.

refactor(shared-worker): change request aggregate by authKey

Use access token (auth key) content instead of base64 encoded token to identify PubNub clients,
which can be used for requests aggregation.

Fix issue because of errors returned by `fetch` taken from `iframe` (to protect against
monkey-patching by APM packages) was't handled as Error.

feat(listener): `SubscriptionSet` listener will receive updates from new Subscription

`SubscriptionSet` will re-add listener every time when `Subscription` or `SubscriptionSet`
added to it - this will let receive updates from newly added subscribe capable objects.
@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 11, 2025
@parfeon parfeon self-assigned this Mar 11, 2025
@parfeon parfeon changed the title Fix fetch error handling Fix fetch errors handling Mar 11, 2025
return true;
}

return Object.prototype.toString.call(object) === '[object Error]';
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

Use access token (auth key) content instead of base64 encoded token to identify PubNub clients,
which can be used for requests aggregation.
*
* @returns Tuple with parsed access token and its stringified content hash string.
*/
private async stringifyAccessToken(tokenString: string): Promise<[PAM.Token | undefined, string | undefined]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

@parfeon
Copy link
Contributor Author

parfeon commented Mar 13, 2025

@pubnub-release-bot release

@parfeon parfeon merged commit e80c970 into master Mar 13, 2025
6 of 7 checks passed
@parfeon parfeon deleted the fix/fetch-error-handling-subscription-listener branch March 13, 2025 15:01
@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