Skip to content

Client "onStatusChange" is not called for errors #53

@karstenda

Description

@karstenda

When receiving an error (e.g. "Evicted") from the backend, the client doesn't trigger it's onStatusChange callback because the room is cleaned up before the callback gets executed.

The key issue is in packages\loro-websocket\src\client\index.ts on line 719-721:

// Remove local room state so client does not auto-retry unless requested
this.cleanupRoom(msg.roomId, msg.crdt);
this.emitRoomStatus(roomId, RoomJoinStatus.Error);

Since the room is already cleaned up before emitting the status, the emitting fails and the onStatusChange callback is never invoked. These two lines should be switched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions