Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAS.ts assumes arrays are from the same JS realm #2811

Closed
freaktechnik opened this issue Oct 26, 2022 · 0 comments · Fixed by #2812
Closed

SAS.ts assumes arrays are from the same JS realm #2811

freaktechnik opened this issue Oct 26, 2022 · 0 comments · Fixed by #2812
Assignees

Comments

@freaktechnik
Copy link
Contributor

freaktechnik commented Oct 26, 2022

SAS.ts assumes the array from the SAS response is from the same JS realm, since it uses instanceof Array to detect if it really got an array:

return anArray instanceof Array ? anArray.filter(x => aSet.has(x)) : [];

However, with the switch to fetch the arrays in parsed JSON responses don't come from the same JS realm as the SDK is running in (apparently). Changing the code to use Array.isArray fixes the issues for us.

@t3chguy t3chguy self-assigned this Oct 26, 2022
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Nov 12, 2022
* Loading threads with server-side assistance ([\matrix-org#2735](matrix-org#2735)). Contributed by @justjanne.
* Support sign in + E2EE set up using QR code implementing MSC3886, MSC3903 and MSC3906 ([\matrix-org#2747](matrix-org#2747)). Contributed by @hughns.
* Replace `instanceof Array` with `Array.isArray` ([\matrix-org#2812](matrix-org#2812)). Fixes matrix-org#2811.
* Emit UnreadNotification event on notifications reset ([\matrix-org#2804](matrix-org#2804)). Fixes element-hq/element-web#23590.
* Fix incorrect prevEv being sent in ClientEvent.AccountData events ([\matrix-org#2794](matrix-org#2794)).
* Fix build error caused by wrong ts-strict improvements ([\matrix-org#2783](matrix-org#2783)). Contributed by @justjanne.
* Encryption should not hinder verification ([\matrix-org#2734](matrix-org#2734)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants