livekit / client-sdk-flutter

Flutter Client SDK for LiveKit
https://docs.livekit.io
Apache License 2.0
255 stars 125 forks source link

[bug] Can not take RoomMetadataChangedEvent sometimes #400

Open FantaZZ opened 11 months ago

FantaZZ commented 11 months ago

Describe the bug

Can not take RoomMetadataChangedEvent sometimes.

I add some print in signal_client.dart.

  Future<void> _onSocketData(dynamic message) async {

    print('livekit ws got msg');

    if (message is! List<int>) return;
    final msg = lk_rtc.SignalResponse.fromBuffer(message);

    print('livekit ws msg type = ${msg.whichMessage().name}');

    switch (msg.whichMessage()) {
    ...

Then I send update room meta message by cli.

livekit-cli update-room-metadata --room room1 --metadata "test"
livekit-cli update-room-metadata --room room1 --metadata ""

When I send a "test" message print nothing. When I send a "" message print :

I/flutter (22447): livekit ws got msg
I/flutter (22447): livekit ws msg type = roomUpdate

Repeat send "test" message or "" message also print nothing.
Alternate send , after "" message will got print.

May be the bug is hidden in server-end ?

Platform information

FantaZZ commented 11 months ago

When I run example app. This still happens.

FantaZZ commented 11 months ago

https://github.com/livekit/livekit/blob/bcce9c26ebcc5b89e8cb307a9f1870f631cf1879/pkg/rtc/room_test.go#L684-L686

"updates are sent when participant joined"

I can not read go language. Is that mean room meta update notify only when participant join or leave ?