Skip to content

Make unsubscribe-inside-callback work in case of back-to-back updates #28

@lawrence-forooghian

Description

@lawrence-forooghian

The subscription handling added in #27 has a failing test unsubscribeInsideCallback_backToBackUpdates. That is — if you have a LiveObject that emits multiple updates one after another synchronously, then unsubscribing inside the first listener call will not prevent the listener from being called for the second update. This is a bit tricky to fix given the mutable-state-struct approach that I've taken for storing the subscriptions (didn't think of this issue at the time). Don't think it's a high priority to fix, given that a given LiveObject coalesces its updates anyway so I don't think it'll ever be emitting multiple updates synchronously. And we might revisit how we do unsubscribe-inside-callback anyway.

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working. It’s clear that this does need to be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions