Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ SCONS_FLAGS=""
LIVEKIT_VERSION="0.3.1"
GODOT_CPP_VERSION="godot-4.5-stable"
FRAMETAP_VERSION="0.1.3"
LIVEKIT_JS_VERSION="2.22.3"
LIVEKIT_JS_SHA256="0f920230001fcbfdccb0bcd2efffd64da8594808908953ed466d4c39c1529fa3"
LIVEKIT_JS_VERSION="2.24.0"
LIVEKIT_JS_SHA256="88b41eb0905a66dd3f46009c9a024aa72503b53398ae9a70c1f60258d246d262"
SKIP_FRAMETAP=false
SKIP_LIVEKIT_SDK=false

Expand Down Expand Up @@ -236,8 +236,11 @@ fetch_livekit_js() {
verify_checksum "${archive}" "${LIVEKIT_JS_SHA256}"
rm -rf livekit-js
mkdir -p livekit-js
tar -xzf "${archive}" -C livekit-js --strip-components=2 package/dist/livekit-client.umd.js package/dist/livekit-client.e2ee.worker.js
tar -xzf "${archive}" -C livekit-js --strip-components=1 package/LICENSE
# npm gives every file the same 1985 timestamp, which SCons would take to mean that a
# different version's files are unchanged, and keep embedding the old version. (-m stamps
# them with the current time instead.)
tar -xmzf "${archive}" -C livekit-js --strip-components=2 package/dist/livekit-client.umd.js package/dist/livekit-client.e2ee.worker.js
tar -xmzf "${archive}" -C livekit-js --strip-components=1 package/LICENSE
rm "${archive}"
echo "$LIVEKIT_JS_VERSION" > livekit-js/.version
echo -e "${GREEN}livekit-client downloaded successfully!${NC}"
Expand Down
3 changes: 1 addition & 2 deletions src/web/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Web build

Web exports can't load the native LiveKit SDK, so the web build implements the same classes on top of [livekit-client](https://github.com/livekit/client-sdk-js) (2.22.3, embedded in the extension). The C++ in this directory registers the classes and calls `bridge.js`, which drives livekit-client and queues its events for the frame callback to emit as signals.
Web exports can't load the native LiveKit SDK, so the web build implements the same classes on top of [livekit-client](https://github.com/livekit/client-sdk-js) (2.24.0, embedded in the extension). The C++ in this directory registers the classes and calls `bridge.js`, which drives livekit-client and queues its events for the frame callback to emit as signals.

The web build is meant to behave like the native one, and the shared tests in `test/` run against both. This page lists where it can't, with the reasons. The [README's web section](../../README.md#web) covers the export settings.

Expand Down Expand Up @@ -58,4 +58,3 @@ Media and data are encrypted by livekit-client's encryption worker, which is emb
- **Sends wait for encryption.** The connection is only reported once the worker confirms encryption is on. `publish_data()`, `perform_rpc()` and `publish_track()` wait for key and encryption changes requested before them, then fail rather than send unencrypted if encryption is on but couldn't start, if the local participant's frame cryptor is disabled, or (for data) if the local participant has no key.
- **A shared key's automatic ratchets aren't visible.** The worker only reports ratchets of per-participant keys, so `get_shared_key()` keeps returning the key from before a receiver ratcheted it.
- **With `failure_tolerance` of 0 or more,** a shared or local key that's exceeded it at an index that isn't current only recovers once `set_key_index()` switches to that index. (Remote participants' keys, and the current index, recover when they're set again.)
- **Data-only receivers don't follow a sender's ratchet.** A receiver that gets data, but no media, from a sender can't decrypt that sender's data after it ratchets its key. That's a livekit-client bug ([livekit/client-sdk-js#2187](https://github.com/livekit/client-sdk-js/issues/2187)). Media frames do ratchet the receiver's key, after which data decrypts too. Otherwise, set the ratcheted key on the receiver.
19 changes: 19 additions & 0 deletions test/e2e/test_e2ee.gd
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,25 @@ func test_receiver_follows_a_ratcheted_key():
_close(video)


func test_data_only_receiver_follows_a_ratcheted_key():
if _skip_if_unsupported():
return
assert_true(await _connect_both_rooms(_e2ee_options(KEY), _e2ee_options(KEY)), "Both rooms should connect")
var received := []
_room2.data_received.connect(func(data, _participant, _kind, _topic): received.append(data.get_string_from_utf8()))
_room.get_local_participant().publish_data("before".to_utf8_buffer(), true)
await _poll_both(func(): return received.size() >= 1, 5.0)

# Without media, room2 can only ratchet its key when the data doesn't decrypt.
var key_provider := _room.get_e2ee_manager().get_key_provider()
key_provider.ratchet_shared_key()
var new_key := await _await_key_change(key_provider, 0, KEY.to_utf8_buffer())
_room.get_local_participant().publish_data("after".to_utf8_buffer(), true)
await _poll_both(func(): return received.size() >= 2, 5.0)

assert_eq([new_key != KEY.to_utf8_buffer(), received], [true, ["before", "after"]])


func test_receiver_records_a_participant_key_it_ratcheted():
if _skip_if_unsupported():
return
Expand Down
Loading