hypothesis / hypothesis/product-backlog

Determine cause of duplicated highlights in the DB

Open
#956 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
122
Forks
7
PR merge metrics
No merged PRs in 30d

Description

https://sentry.io/hypothesis/h/issues/846053583/events/45521568081/

In all the cases I've looked at so far it appears that the exact same annotation occurs twice in the database. This suggests that for some reason the annotation is being created two times. Further debug is needed to determine why. Is this a lag in submission where the user is able to submit the same annotation multiple times? Is this a frontend bug of some sort? Further investigation is needed.

Below is a correlation between the throughput to the annotation create endpoint and the ConcurrentUpdate errors. Note where there is a spike in errors there is also a spike in the amount of annotations created thus it appears that ConcurrentUpdate errors are related to duplicated annotations being created.

image
image

Below are several snip-its of annotations inside the db. Note the duplication (the time stamp and id are the only thing shown here for privacy reasons).
image
image

Here's a link to the first occurrence of this problem reflected in duplicated annotations being created inside the db:
https://metabase.hypothes.is/question#eyJuYW1lIjpudWxsLCJkYXRhc2V0X3F1ZXJ5Ijp7InF1ZXJ5Ijp7InNvdXJjZS10YWJsZSI6NDcsImZpbHRlciI6WyJhbmQiLFsiPSIsWyJmaWVsZC1pZCIsNDAyMl0sNTA1MjQ2XV19LCJ0eXBlIjoicXVlcnkiLCJkYXRhYmFzZSI6NX0sImRpc3BsYXkiOiJ0YWJsZSIsInZpc3VhbGl6YXRpb25fc2V0dGluZ3MiOnt9fQ==

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Sentry event and compare the annotation create endpoint throughput with the ConcurrentUpdate errors. Inspect the duplicated annotation examples and determine whether repeated submission or a frontend issue explains the database duplicates; document the confirmed cause and supporting evidence.

Written by the indexing model from the issue text.

Assessment

Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.