Skip to content

Replication pause ensureNotFalsy() throws #7264

@KingSora

Description

@KingSora

Good day! :)

Since we update rxdb to v16.15.0 our sentry is getting spammed with ensureNotFalsy errors. This is happening because of the toggleOnDocumentVisible option introduced in v16.5.0 and the replication state queue which was introduced in v16.13.0.

To be more specific the error is coming from here:

replicationState.pause();
and thrown here:
ensureNotFalsy(this.internalReplicationState).events.paused.next(true);

We also can't really control this behavior, because the whole code is running because of the visibilitychange event.

I'm assuming that this error "isn't really an error" since the replication still runs normaly and ensureNotFalsy is only used so that one can be sure that this.internalReplicationState is not falsy and the replication can be paused. I would say that this error is not helping or saying anything besides "there is an error, but everything continues to work normally".

If this behavior is expected and this.internalReplicationState can be falsy I would suggest to silently ignore it if it happens in the visibilitychange event, since otherwise the error is being spammed for each collection which can be a lot.

If the behavior mustn't happen and this.internalReplicationState must be defined in the queue, then this is a bug.

A test with the reproduction is here: #7265

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions