Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: PDF annotations orphaning in LMS app #875

Closed
klemay opened this issue Aug 8, 2019 · 3 comments
Closed

Spike: PDF annotations orphaning in LMS app #875

klemay opened this issue Aug 8, 2019 · 3 comments
Assignees

Comments

@klemay
Copy link
Contributor

klemay commented Aug 8, 2019

A number of LMS users have reported that upon launching PDF assignments, annotations are orphaned. The issue seems to be specific to the LMS app (no tickets re: PDFs orphaning "in the wild") and to PDFs (no tickets re: orphaning on assignments created with HTML pages).

The problem

When some users launch Hypothesis-enabled PDF assignments, annotations appear as orphans. Usually refreshing the browser window will re-anchor the orphans. Hypothesis support has been unable to reproduce the issue in most cases.

Steps to reproduce

  1. Create an LMS assignment using a PDF
  2. Add annotations to the PDF
  3. Close and re-launch the assignment

Relevant tickets

To see tickets pertaining this issue, go to https://hypothesis.zendesk.com/agent/search/1?q=tags%3A%22orphans%20lms%22

The tickets where we have the most info to work with are:

Ticket 3719: https://hypothesis.zendesk.com/agent/tickets/3719

  • LMS: Canvas
  • PDF: Doyle-Round the Red Lamp.pdf
  • not able to reproduce on our end, and only one student reported this issue (the professor + other students did not have the same issue)

(Update (2019-08-27): I was able to reproduce the issue and filed as hypothesis/client#1329 - @robertknight)

Ticket 4172: https://hypothesis.zendesk.com/agent/tickets/4172

  • LMS: Canvas
  • PDF: healy and kamya 2014 .pdf
  • not able to reproduce in our Canvas instance, but refreshing the browser window fixed the orphaning issue for the user

Ticket 4173: https://hypothesis.zendesk.com/agent/tickets/4173

(Update (2019-08-27): I was able to reproduce the issue sporadically and capture more error details. Issue filed as hypothesis/client#1330 - @robertknight)

Ticket 4216: https://hypothesis.zendesk.com/agent/tickets/4216

Ticket 4276: https://hypothesis.zendesk.com/agent/tickets/4276

@robertknight
Copy link
Member

Ticket 3719: https://hypothesis.zendesk.com/agent/tickets/3719
LMS: Canvas
PDF: Doyle-Round the Red Lamp.pdf
not able to reproduce on our end, and only one student reported this issue (the professor + other students did not have the same issue)

I was able to reproduce an issue which sounds like what the student describes. It occurred when selecting very specific content in the PDF on page 26, taken from the screenshot in the issue:

Reproduced in Safari 12.1.2:

  1. Copy the PDF URL and paste it into https://via.hypothes.is
  2. Search for the text "smiled" and select the full text of the paragraph that begins "The doctor smiled" and the next paragraph that begins "He is very weak" and ends "you must send for me", including the quote characters
  3. Click the "Annotate" button

Expected result: New annotation appears in the "Annotations" tab
Actual result: Annotation appears in the "Orphans" tab immediately

I've also seen an issue where the annotation appears in the "Annotation" tab initially but once the user clicks "Post to " it appears in the "Orphans" tab a moment later.

I added some logging to the place where failed anchoring tasks are caught in guest.coffee. Sometimes when trying to annotate the text for a second time, the following error occurred and the annotation appears in the Orphans tab immediately:

Screenshot 2019-08-25 16 18 37

When the annotation moved to the Orphans tab only after saving, a different error caused the failure:

Screenshot 2019-08-25 16 19 26

@robertknight
Copy link
Member

robertknight commented Aug 25, 2019

Testing in a few other places in the PDF I can reproduce whenever making a selection that includes the last character of the page. More specifically it happens when the selection includes the last character in the last Text node in the div.textLayer element for the page.

I would guess there may be multiple different issues here, in which case part of the work will involve splitting out various sub-issues.

@robertknight
Copy link
Member

I think it is fairly likely that the cases where refreshing fixes / sometimes fixes the issue are all instances of hypothesis/client#1330.

So this means there are two separate issues here that we need to resolve:

  1. A race condition that sporadically causes all annotations to orphan: Race condition causes annotations to sometimes fail to anchor in PDFs client#1330
  2. A deterministic issue that causes annotations of certain content on a page to orphan: Annotations immediately orphan when selecting text in a PDF that includes last character on page client#1329

Once we resolve these two issues, I think we can consider this issue resolved for the time being and re-open if problems still occur.

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

No branches or pull requests

2 participants