Commit Graph

2212 Commits

Author SHA1 Message Date
Valere Fedronic bc0ea20343 Default vite config to support using local build of crypto wasm (#3038)
* Devex: Default vite config to support using local build of crypto wasm

* use realpathSync and make it work with linked and not-linked
We need to use sync because an async defineConfig fails for the embedded exports.

* also allow just linking matrix-sdk-crypto-wasm (without js-sdk linking)
---------

Co-authored-by: Timo <toger5@hotmail.de>
Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
Co-authored-by: Robin <robin@robin.town>
2025-04-04 23:24:42 +02:00
Valere f0126f41fb Widget: Add missing to device permission for encryption keys 2025-04-04 09:32:34 +02:00
Hugh Nimmo-Smith d1753c33f5 Use correct rageshake URL when running in embedded package + tests (#3132)
* Use correct rageshake URL when running in embedded package

It was incorrectly trying to use the one from config.json

* Refactor to add tests

* Empty mock config
2025-03-31 16:38:25 +01:00
Timo 2073cd3ac1 Rename EULA to SSLA (#3135)
* Change EULA to SSLA
 - rename i18n fields
 - update the config property to `ssla` and deprecate `eula`
 - use `eula` instead of ssla in case it is provided in the config.

* fix default config

* completely remove eula fallback
2025-03-31 14:18:45 +02:00
Hugh Nimmo-Smith bfd4bb2ec1 Show URL params and environment variables in developer tab (#3134) 2025-03-27 16:35:31 -04:00
Robin aab4efe03a Use type imports consistently 2025-03-27 16:09:59 -04:00
Robin eb18cbef78 Consolidate imports 2025-03-27 16:04:03 -04:00
Robin ae339ea5cc Fix formatting issues 2025-03-27 14:47:01 -04:00
Robin 33700d1529 Merge branch 'livekit' into toger5/src-to-lib-import 2025-03-27 14:35:08 -04:00
Robin f99eb3c88f Merge branch 'livekit' into robin/berry 2025-03-27 14:07:24 -04:00
Robin 0ed1564d3e Merge branch 'livekit' into robin/posthog-logout 2025-03-24 10:10:28 -04:00
Robin cd5ecb2352 Rename error boundary hook
It doesn't check whether it's actually used inside a GroupCallErrorBoundary, and it's generally useful for interacting with any error boundary, so I'm giving it a generic name to reflect this.
2025-03-21 15:17:41 -04:00
Robin 9a5dd10e27 Show errors that occur in GroupCallView using the error boundary
We were previously using the useGroupCallErrorBoundary hook to surface errors that happened during joining, but because that part is outside the GroupCallErrorBoundary it just ended up sending them to the app-level error boundary where they got displayed with a more generic message.
2025-03-21 14:59:27 -04:00
Hugh Nimmo-Smith 9bf046b714 Merge branch 'livekit' into robin/berry 2025-03-21 17:14:10 +00:00
Hugh Nimmo-Smith 6043b3949b Analytics configuration is the responsibility of the host application when running in widget mode (#3089)
* Support for analytics configuration via URL parameters in widget mode

Adds:

- posthogApiHost
- posthogApiKey
- rageshakeSubmitUrl
- sentryDsn
- sentryEnvironment

Deprecate analyticsId and use posthogUserId instead

* Partial test coverage

* Simplify tests

* More tests

* Lint

* Split embedded only parameters into own section for clarity

* Update docs/url-params.md

* Update docs/url-params.md

* Update vite.config.js
2025-03-21 11:15:20 +01:00
Valere fd20ac4022 Merge branch 'livekit' into valere/async_error_show_boundary 2025-03-19 09:30:16 +01:00
Robin 45c3c7a37e Show "insufficient capacity" when hitting participant limits 2025-03-18 13:33:36 -04:00
Valere 007ea89cd7 fixup eslint 2025-03-17 12:36:14 +01:00
Valere 83c6ec3497 Merge branch 'livekit' into valere/async_error_show_boundary 2025-03-17 11:26:54 +01:00
Valere 03b5f0f2f9 Fixup: error boundary context not needed, local error resets already 2025-03-17 11:26:16 +01:00
Valere b5fff42adc Test: Add more integrations test
Testing access, register, login, logout. Create and join as guest
2025-03-14 11:01:19 +01:00
Robin fee9841183 Remove the dependency on buffer
It's not generally available in browser environments / certain Yarn modes and can easily be replaced by TextEncoder.
2025-03-14 02:09:48 -04:00
Timo 6f93a037cf import cleanups 2025-03-13 18:00:24 -04:00
Timo f0545ced65 make it work withotu js-sdk changes 2025-03-13 18:00:24 -04:00
Timo 46f5c44db0 temp2 2025-03-13 18:00:07 -04:00
Timo adb5934f0b temp 2025-03-13 17:51:41 -04:00
Valere 188fe75534 Merge branch 'livekit' into valere/async_error_show_boundary 2025-03-13 11:20:32 +01:00
Valere Fedronic 90a282b46c Merge pull request #3063 from element-hq/valere/fix_add_close_button_in_widget_mode
Error: use a close button instead of go to home when in widget mode
2025-03-13 10:16:26 +01:00
Valere Fedronic 79e294755c Merge pull request #3058 from element-hq/valere/refactor_error_handling
refactor: Centralize group call errors in custom GroupCallErrorBoundary
2025-03-13 10:12:11 +01:00
Hugh Nimmo-Smith 7aac56aac0 Vite embedded build of Element Call (#3077)
* Embedded package build of Element Call

Part of https://github.com/element-hq/element-call/issues/2994

This creates a new "embedded" build (vs "full" build) at the vite level. It will be used by a later PR that actually provides platform specific packages.

Embedded build:

- Uses relative URLs
- Uses relative config.json path and other resource loading
- Has a config.json built in
- Doesn't include the public folder (e.g. favicon)

Out of scope:

- this doesn't attempt to exclude SPA functionality, so technically the build could be used in SPA
- the above means that the crypto-wasm binary is included in the build

* CI artifact name based on type of build

* Update src/config/Config.ts
2025-03-12 17:00:44 +00:00
Hugh Nimmo-Smith 520c0f4925 Fix typing on config: EULA is optional as it has a default (#3074) 2025-03-12 13:52:13 +01:00
Valere b02ad8871e review: Make widget prop mandatory 2025-03-12 10:27:45 +01:00
Valere b0a4a954f8 Error: use a close button instead of go to home when in widget mode 2025-03-12 10:12:34 +01:00
Valere 612ace137a code review: recoveryActionHandler should not be optional 2025-03-12 09:44:41 +01:00
Valere 8584521ade fixup: post rebase fix 2025-03-11 20:19:14 +01:00
Valere c0ef6e5e4d fix: Error recover/retry buttons should reset error state 2025-03-11 16:54:19 +01:00
Valere 4c27551014 refactor: Centralize group call errors in custom GroupCallErrorBoundary 2025-03-11 16:54:19 +01:00
Hugh Nimmo-Smith 1a692b983a Use fetch() in a way that works for file URLs (#3071)
fetch returns a response code of 0 when it successfully loads a `file://` resource.

This means we can't just rely on `response.ok`.

Required for https://github.com/element-hq/element-call/issues/2994
2025-03-11 10:39:51 +01:00
Valere 04a46ebabe error management: Handle fail to get JWT token 2025-03-11 09:07:19 +01:00
Valere 343da0db14 network: Utility to retry network operation with backoff 2025-03-10 17:54:50 +01:00
Valere c22412c045 error management: showError API for async error handling 2025-03-10 15:20:51 +01:00
Hugh Nimmo-Smith 30b5bcdfb6 Cache calls to removeHiddenChars() to fix performance bottleneck in Safari (#3066)
* Cache calls to removeHiddenChars() as very slow on Safari

Fixes #3065

* Test

* Split testing for removeHiddenChars
2025-03-10 13:55:03 +00:00
Timo b635b00b0c Expose setLKLogLevel to window for debugging. (#3064)
* Expose setLKLogLevel to window for debugging.

* fix es lint
2025-03-10 08:59:27 +00:00
Timo 750db09156 Use the New MatrixRTCSession MembershipManager (#3015)
* provide option to use the New MembershipManager

* fix cryptoApi import change

* add error screen

* bump js-sdk

* rename to `setUnrecoverableError` and remove onLeave call because that will be handled by an effect.

* this was doing nothing (it is a fragment back when there was no deprecated `rtcSession.room`)

* rename to error

* Update src/utils/errors.ts

Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>

* Update src/utils/errors.ts

Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>

* review

* bump js-sdk

* expose lk log level changing in `window`

* bump js-sdk
 - always log "Missing own membership: force re-join"
 - also check insertions queue

* change lk log level to warn

* Bump js-sdk

* Bump js-sdk

* .

* Bump js-sdk

* show user count based on meberships not users.

Signed-off-by: Timo K <toger5@hotmail.de>

* bump js-sdk

* rename setting name

* remove unused import

* js sdk bump

* remove `window.setLKLogLevel`

* bump js sdk with reverted incompatible change

* bump js-sdk with one less merge

---------

Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2025-03-07 16:27:04 +00:00
Valere 13a19ed751 fix: Error recover/retry buttons should reset error state 2025-03-07 15:18:32 +01:00
Timo c9f2a1c943 Reduce redundant calculations of display name map (#3062)
* Use share() on fromEvent() so that we multiplex subscribers onto the event emitter

* .

* .

* Comment

* Comment

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2025-03-07 10:18:28 +00:00
Valere 28c7c9dd38 refactor: Centralize group call errors in custom GroupCallErrorBoundary 2025-03-05 20:50:19 +01:00
Robin b5f5ab329a Merge pull request #3051 from element-hq/robin/return-to-lobby
Respect the returnToLobby flag
2025-03-05 12:17:53 -05:00
Robin 359812d8b1 Explain why returnToLobby is false in SPA 2025-03-05 10:40:37 -05:00
Robin 5b1ea4501d Send a 'join' action when entering the call
Following a75952cf77, this is one more upgrade to the widget communication that I'd like to make within this release cycle.

The motivating issue is https://github.com/element-hq/element-web/issues/29429. Fundamentally, without a 'join' action, the only info Element Web can use to determine whether it's joined the call is whether a MatrixRTC membership exists. But membership state events can inaccurately represent the client's actual state (whether because delayed events aren't supported, or because the delayed event hasn't timed out yet), so I suggest we send a 'join' action here just as we do in the Element Web Jitsi wrapper (https://github.com/element-hq/element-web/blob/e9a3625bd6e9a64f216e3caeabca66f48b649332/src/vector/jitsi/index.ts#L503) to let Element Web tap directly into the widget's local state. (This will need additional Element Web changes, but is certainly backwards compatible.)
2025-03-05 09:25:52 -05:00