Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type given for the connect.Agent.onWebSocketConnectionLost event handler callback function #845

Open
JPjoe99 opened this issue Feb 27, 2024 · 1 comment

Comments

@JPjoe99
Copy link

JPjoe99 commented Feb 27, 2024

Repository version - 2.13.1

The type given for the connect.Agent.onWebSocketConnectionLost event handler callback function doesn't currently match what's given in actual use.

I'm currently accessing the event handler callback function in the following manner:

connect.agent(agent => {
  ...
  agent.onWebSocketConnectionLost(agent => {
    ...
  });
});

I updated this to log out the arguments of the callback function:

connect.agent(agent => {
  ...
  agent.onWebSocketConnectionLost((...args) => {
    console.log(args);
    ...
  });
});

Based on the type definition of the callback function, I'd expect this to log an instance of the Connect Agent API object, but it instead logs the following:

[
  {
      "openTimestamp": 1709053767247,
      "closeTimestamp": 1709053783420,
      "connectionDuration": 16173,
      "code": 1006,
      "reason": ""
  },
  "agent::websocket_connection_lost",
  {
    subMap: SubscriptionMap,
    logEvents: false
  } // EventBus object
]
Copy link

This issue is stale because it has been open for 90 days with no activity. Remove stale label or comment to keep this active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant