brawl-chat icon indicating copy to clipboard operation
brawl-chat copied to clipboard

Constraint error on byEventId during sync

Open bwindels opened this issue 5 years ago • 3 comments

Error in status bar:

Sync failed because of Error: wrapped DOMException: (name: ConstraintError) (code: ConstraintError) Unable to add key to index 'byEventId': at least one key does not satisfy the uniqueness requirements.

In console:

Uncaught (in promise) Error: add on undefined failed: (name: ConstraintError) (code: ConstraintError) Unable to add key to index 'byEventId': at least one key does not satisfy the uniqueness requirements.
    at Store.add (brawl.js:3685)
8brawl.js:3685 Uncaught (in promise) Error: add on undefined failed: (name: AbortError) (code: AbortError) The transaction was aborted, so the request cannot be fulfilled.
    at Store.add (brawl.js:3685)
brawl.js:3676 Uncaught (in promise) Error: put on undefined failed: (name: AbortError) (code: AbortError) The transaction was aborted, so the request cannot be fulfilled.
    at Store.put (brawl.js:3676)
brawl.js:686 unable to commit sync tranaction
_syncRequest @ brawl.js:686

bwindels avatar Jun 17 '20 16:06 bwindels

A refresh fixed the issue...

bwindels avatar Jun 17 '20 16:06 bwindels

Perhaps the server returned a duplicate event id? But I thought we filtered those out?

bwindels avatar Jun 17 '20 16:06 bwindels

We do filter them out, but only when filling gaps, not during sync... https://github.com/bwindels/brawl-chat/blob/master/src/matrix/room/timeline/persistence/GapWriter.js#L40

bwindels avatar Jun 17 '20 16:06 bwindels