Skip to content

[Document-URI: 2] Sync checkpoints with document identity - #7412

Draft
karenrasmussen wants to merge 12 commits into
mainfrom
hnr-document-uri
Draft

[Document-URI: 2] Sync checkpoints with document identity#7412
karenrasmussen wants to merge 12 commits into
mainfrom
hnr-document-uri

Conversation

@karenrasmussen

@karenrasmussen karenrasmussen commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces support for tracking and reporting the canonical document identity (URI) for assignments, particularly to enable reliable Hide & Reveal (checkpoint) functionality. The changes ensure that the backend and frontend coordinate on the document's true identity as computed by the Hypothesis client, rather than just the launch URL. This is crucial for syncing checkpoint state and revealing assignments accurately, especially in cases where the launch URL does not uniquely identify the document in Hypothesis.

Key changes include:

Database and Model Updates

  • Added a nullable document_uri column to the assignment table and model to store the canonical document identity as determined by the Hypothesis client. This value is cleared and reset if the assignment's document URL changes. [1] [2] [3]

Backend API and Service Changes

  • Updated the /api/sync endpoint to accept and store the reported document_uri from the frontend, and to use this value (if present) for checkpoint syncing. The checkpoint payloads and reveal logic now consistently use document_uri instead of document_url. [1] [2] [3] [4] [5] [6]
  • Added logic to prevent revealing checkpoints if the document identity has not yet been reported by the client.

Frontend/Client Coordination

  • The frontend now waits for the Hypothesis client to report the document's h identity (document_uri) via RPC before syncing checkpoints. This is handled via new client-RPC infrastructure and ensures that checkpoint syncs are keyed to the correct document. [1] [2] [3] [4] [5]

@Elimpizza
Elimpizza changed the base branch from main to hnr-document-uri-migration July 24, 2026 17:14
@Elimpizza Elimpizza changed the title Sync checkpoints with the document's h identity [Document-URI: 2] Sync checkpoints with document identity Jul 24, 2026
Comment thread lms/services/document_uri.py Outdated
@Elimpizza
Elimpizza changed the base branch from hnr-document-uri-migration to main July 28, 2026 18:54
@karenrasmussen
karenrasmussen marked this pull request as ready for review July 29, 2026 13:51
@Elimpizza
Elimpizza marked this pull request as draft July 30, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants