Skip to content

Properly Shutdown pusher-js client to ensure any pending messages are sent. #669

Closed
@jamesrusso

Description

@jamesrusso

Do you want to request a feature or report a bug?

Feature/Clarification

What is the current behavior?

There is no clear way to shutdown the pusher-js client while waiting for any pending messages to be emitted and delivered to the server. We are using private channels to allow some backend process exchange messages with a web front end. However, when we send our final message indicating sign-off and then exit the node process, often the message is not received by the remote agent, I assume because the node process has exited before the message could be sent.

If the current behavior is a bug, please provide the steps to reproduce and
if possible a minimal demo of the problem via https://jsfiddle.net or similar.

I can try and work on a jsfiddle example and will update the ticket.

What is the expected behavior?

I would expect there be some type of promise which could be awaited to shutdown the pusher-js client to ensure delivery of any pending messages (and prevent queuing of additional messages). Some type of wind down functionality.

Which versions of Pusher, and which browsers / OS are affected by this issue?
Did this work in previous versions of Pusher? If so, which?

7.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions