hypothesis / product-backlog

Where new feature ideas and current bugs for the Hypothesis product live
118 stars 7 forks source link

In-context URLs don't work on Simplecast transcript pages #1353

Open mattdricker opened 2 years ago

mattdricker commented 2 years ago

Bug report form

Reported by user: https://app.hubspot.com/contacts/6291320/ticket/891020862/

Steps to reproduce

  1. Create an annotation on a podcast transcript page hosted at simplecast.com. E.g. https://complexity.simplecast.com/episodes/82/transcript
  2. Generate share link to that annotation, and open share link in new tab. E.g. https://hyp.is/Q9iQIspBEeyGZ2fwKw1OOw/complexity.simplecast.com/episodes/82/transcript

Expected behaviour

Page should open with shared in-context annotation selected and visible.

Actual behaviour

Simplecast displays a 404 Not Found page.

Screen Shot 2022-05-02 at 2 09 13 PM

Browser/system information

Issue occurs across all browsers tested, as well as over Via.

Additional details

Visiting page URL and activating Hypothesis extension or bookmarklet shows all annotations as expected. Problem only occurs with in-context share URLs.

Issue only seems to occur on */transcript pages. Many other pages tested at same site and in-context URLs worked fine.

chrisshaw commented 2 years ago

I think the answer is going to be, we don't support all web apps, but we'll have someone confirm it.

From my glance, I would guess that our URL fragment for the annotation id mangling the Simplecast API's /search endpoint. This could be a red herring, though. Curiously, it calls this endpoint twice, and the first one works with a 200. The second one then truncates (?) the annotation ID and fails with a 404. I then suspect this is what's causing the redirect to 404.

$ curl 'https://api.simplecast.com/sites/search' \
>   -H 'authority: api.simplecast.com' \
>   -H 'accept: application/json, text/plain, */*' \
>   -H 'accept-language: en-US,en;q=0.9' \
>   -H 'content-type: application/json;charset=UTF-8' \
>   -H 'origin: https://complexity.simplecast.com' \
>   -H 'referer: https://complexity.simplecast.com/' \
>   -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"' \
>   -H 'sec-ch-ua-mobile: ?0' \
>   -H 'sec-ch-ua-platform: "Windows"' \
>   -H 'sec-fetch-dest: empty' \
>   -H 'sec-fetch-mode: cors' \
>   -H 'sec-fetch-site: same-site' \
>   -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
>   --data-raw '{"url":"https://complexity.simplecast.com/episodes/82/transcript#annotations:Q9iQIspBEeyGZ2fwKw1OOw"}' \
>   --compressed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1175  100  1074  100   101   5035    473 --:--:-- --:--:-- --:--:--  5595
{"href":"https://api.simplecast.com/sites/e42d8371-30d8-4c8c-8a95-69e018500dcc","updated_at":"2019-10-09T22:44:24","update":null,"twitter":"sfiscience","theme":"light","texture":false,"subdomain":"complexity","site_links":{"href":"https://api.simplecast.com/sites/e42d8371-30d8-4c8c-8a95-69e018500dcc/links?location=social","create":null,"collection":[{"href":"https://api.simplecast.com/links/c116f112-919f-4d28-bc99-34b9dc3fc171","url":"https://youtube.com/c/sfiscience","order":null,"new_window":true,"name":"YOUTUBE","location":"social","is_visible":true,"id":"c116f112-919f-4d28-bc99-34b9dc3fc171","icon":null},{"href":"https://api.simplecast.com/links/257ab18d-8580-4250-8c20-3187aa352b7e","url":"https://santafe.edu/podcast","order":null,"new_window":true,"name":"WEBSITE","location":"social","is_visible":true,"id":"257ab18d-8580-4250-8c20-3187aa352b7e","icon":null}]},"podcast":{"href":"https://api.simplecast.com/podcasts/812a2932-f271-4e9b-a23f-8d2d443a1682","title":"COMPLEXITY","status":"published","is_pending_invitation":null,"import":null,"image_url":"https://image.simplecastcdn.com/images/d79bf6d9-c873-44b7-9280-c30fa5bd4b99/d99b4674-0cd5-42bc-9b0d-25dcd8ca3b09/complexity-podcast-show-cover-image.jpg","id":"812a2932-f271-4e9b-a23f-8d2d443a1682","episodes":{"count":82},"account_id":"5a385cbb-48a0-438a-90d8-bc3ebd3830db","account":null},"patreon":null,"menu_links":{"href":"https://api.simplecast.com/sites/e42d8371-30d8-4c8c-8a95-69e018500dcc/links?location=menu","create":null,"collection":[{"href":"https://api.simplecast.com/links/c20e0ca9-4347-4474-a267-63667afff342","url":"https://facebook.com/groups/santafeinstitute","order":100,"new_window":true,"name":"Discussion Group","location":"menu","is_visible":true,"id":"c20e0ca9-4347-4474-a267-63667afff342","icon":null},{"href":"https://api.simplecast.com/links/ab6885a9-7d85-40ea-8d0d-e7e288211de3","url":"https://complexityexplorer.org","order":300,"new_window":true,"name":"Online Courses","location":"menu","is_visible":true,"id":"ab6885a9-7d85-40ea-8d0d-e7e288211de3","icon":null},{"href":"https://api.simplecast.com/links/422f49e4-8f6a-4875-85a8-1aefb9f6c20f","url":"https://www.santafe.edu/engage/support","order":300,"new_window":true,"name":"Donate","location":"menu","is_visible":true,"id":"422f49e4-8f6a-4875-85a8-1aefb9f6c20f","icon":null}]},"linkedin":"https://linkedin.com/company/20131/","legacy_theme_settings":null,"legacy_theme_logo":null,"legacy_theme_background_image":null,"legacy_hosts":null,"instagram":"sfiscience","id":"e42d8371-30d8-4c8c-8a95-69e018500dcc","ga_tracking_id":null,"fb_pixel_id":null,"favicon_url":"https://image.simplecastcdn.com/images/d79bf6d9-c873-44b7-9280-c30fa5bd4b99/292edfb3-ee8c-4b42-a3a3-f0e3f9058d67/sfi-mimbres-black.jpg","favicon_path":"/prod/images/d79bf6d9-c873-44b7-9280-c30fa5bd4b99/292edfb3-ee8c-4b42-a3a3-f0e3f9058d67/sfi-mimbres-black.jpg","facebook":"https://facebook.com/santafeinstitute","external_website":null,"do_not_track":false,"deleted_at":null,"created_at":"2019-10-08T19:16:52","color":"#000000","cname_url":null}

$ curl 'https://api.simplecast.com/episodes/search' \
>   -H 'authority: api.simplecast.com' \
>   -H 'accept: application/json, text/plain, */*' \
>   -H 'accept-language: en-US,en;q=0.9' \
>   -H 'content-type: application/json;charset=UTF-8' \
>   -H 'origin: https://complexity.simplecast.com' \
>   -H 'referer: https://complexity.simplecast.com/' \
>   -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"' \
>   -H 'sec-ch-ua-mobile: ?0' \
>   -H 'sec-ch-ua-platform: "Windows"' \
>   -H 'sec-fetch-dest: empty' \
>   -H 'sec-fetch-mode: cors' \
>   -H 'sec-fetch-site: same-site' \
>   -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
>   --data-raw '{"url":"https://complexity.simplecast.com/episodes/82/transcript#annotations:Q9iQIspBEey"}' \
>   --compressed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   173  100    83  100    90    382    414 --:--:-- --:--:-- --:--:--   800
{"status":404,"href":null,"error_message":"Resource not found","error":"not_found"}