Skip to content

[RPC] Events are delayed when connecting more than 2 times #7200

Closed
@Hacksore

Description

@Hacksore

Description

I seem to have uncovered either a neat bug or feature that I'm trying to understand why it exists.

tl;dr my app connecting to the RPC websocket after more than two attempts will result in an extended delay for getting events back on stable.

This doesn't seem to happen for your app streamkit at all on stable. Furthermore, on canary this does not happen to my app and every connection is free of any delay in receiving events.

This really messes with auth flow for my app, if users have tried to load the app more than twice and it's cause a confusing UX and they perceive it as not being able to sign in.

I know I'm going to be told that I should be using IPC instead of WebSocket but this is also reproducible on the IPC transport.

IPC repro: https://github.com/Hacksore/test-rpc-djs/blob/test-ready/index.js

Steps to Reproduce

Using my test setup.

  1. Open discord
  2. Load https://overlayed.dev/test (source code)
  3. Refresh (it loads ready)
  4. Refresh (it loads ready)
  5. It is stuck waiting for the READY event

alternatively use the IPC repro I gave above and run the script a few times.

Expected Behavior

Should allow me to connect without delay in responses.

Current Behavior

Delay in getting events back after 2 connection attempts.

Screenshots/Videos

Built-in.Retina.Display.mp4

Client and System Information

Desktop client:
stable 333428 (3995449) Host 0.0.321 arm64 Build Override: N/A macOS 15 (24.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsyncedSynced to internal tracker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions