Skip to content
New issue

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

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

Already on GitHub? # to your account

Hypothesis LMS app saving annotations on URL with a Hypothesis-made URL parameter #438

Open
mkdir-washington-edu opened this issue Feb 22, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@mkdir-washington-edu
Copy link

mkdir-washington-edu commented Feb 22, 2022

Bug report form

Steps to reproduce

  1. Create an LSM app assignment using the URL www.ascd.org/el/articles/6-intrinsic-motivators-to-power-up-your-teaching
  2. Create an annotation in that assignment
  3. Refresh the page and note the annotation is missing
  4. The annotation is saved to:
    https://www.ascd.org/el/articles/6-intrinsic-motivators-to-power-up-your-teaching?via.client.ignoreOtherConfiguration=1&via.client.openSidebar=1&via.external_link_mode=new-tab&via.client.requestConfigFromFrame.origin=https%3A%2F%2Flms.hypothes.is&via.client.requestConfigFromFrame.ancestorLevel=2&via.blocked_for=lms

Notes:

  • creating an assignment out of the URL with the parameter doesn't fix the issue. The URL without the parameter is still displayed in the LMS app while annotations are still saved to the URL with the parameter
  • Visiting that page without the URL parameter in the web app in Via does not seem to cause those annotations to be saved with the URL parameter.

Example:
https://hypothesis.instructure.com/courses/266/assignments/2811

Expected behaviour

Annotations should save to the URL without the parameter

Browser/system information

Chrome 98
MacOC 11.6

Possible duplicates?

@mkdir-washington-edu mkdir-washington-edu added the bug Something isn't working label Feb 22, 2022
@mkdir-washington-edu
Copy link
Author

@mkdir-washington-edu
Copy link
Author

Additional note: some screenshots from the user's students show that at one point the students could see each others' annotations.

It looks like this is document_id = 1985147, and it looks like the URL with the parameters is equivalent to the URL without parameters.

It looks like a similar problem happened with doc 2005153 and several other docs.

@jon-betts jon-betts transferred this issue from hypothesis/product-backlog Nov 28, 2022
@jon-betts jon-betts self-assigned this Nov 28, 2022
@jon-betts
Copy link
Contributor

jon-betts commented Nov 29, 2022

I think I know what's happening here, but not why, or what to do about it yet.

In order for document equivalence to work, we insert:

<link rel="canonical" href="https://www.ascd.org/el/articles/6-intrinsic-motivators-to-power-up-your-teaching">

But the original page inserts one as well:

<link rel="canonical" href="http://localhost:9085/proxy/mp_/https://www.ascd.org/el/articles/6-intrinsic-motivators-to-power-up-your-teaching?via.client.ignoreOtherConfiguration=1&amp;via.client.openSidebar=1&amp;via.external_link_mode=new-tab&amp;via.client.requestConfigFromFrame.origin=http%3A%2F%2Flocalhost%3A8001&amp;via.client.requestConfigFromFrame.ancestorLevel=2&amp;via.blocked_for=lms">

I don't know exactly how this is happening. One guess is it's dynamically reading the location and putting it in? I don't think we are doing this, but I can check.

I suspect what's happening is the last canonical declaration "wins" and ends up being the one all the annotations are added to.

@jon-betts
Copy link
Contributor

I've added a POC PR to show how we can interact with the canonical values declared by pages. This PR completely destroys it, and this causes all annotations to re-appear.

I don't think this is necessarily the best way to go though.

@jon-betts
Copy link
Contributor

I think this is fixed now? It's a bit hard to say as from the UK there are two separate Cookie popups that render the page mostly un-usable.

@jon-betts
Copy link
Contributor

jon-betts commented Dec 1, 2022

Hmm, I'm not so sure. I'm still seeing broken canonical values...

edit: A bit more detail here. The backend is writing the canonical URL correctly, but something is rewriting it back to the original location (in Via). A few options were discussed, but a potential "fix" which is easy to do is to completely destroy the tag when rewriting the page.

We can delete all attributes from it (although we can't get rid of it completely). This would result in an empty <link/> tag, which wouldn't have anything that could be rewritten. This would give you the same experience as other pages in Via with no canonical tag, but a potentially different experience from visiting the same page with the extension, which would respect the canonical tag. So it's not ideal.

On the other hand this is totally broken right now, so this seems like we could put it in as an interim fix.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants