Skip to content

Observer is not attached to notifier #56

Description

@jesusbotella

Hello everyone!
I'm using @absinthe/socket-apollo-link 0.2.1 (with phoenix 1.5.7), and this error triggers quite frequently after refreshing socket connections.

In our platform, an active socket connection is closed right after the token expires, we refresh the token, and then reconnect it again.

Seems like whenever a socket connection is closed, socket-apollo-link refreshes those observables, but then when Apollo tries to unsubscribe because components are re-rendering after the credentials change, socket-apollo-link does not find those previously registered observables that Apollo has but the notifier is still active.

It doesn't always happen, but I'm receiving error reports quite often because of that, so probably there's a race condition?
Do I need to call Apollo's reFetchObservableQueries after reconnecting the socket to solve this? 🤔

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions