Creating annotation fails on Wired article due to URI decoding error
Update (2023-01-03): The original article is no longer available, but see https://github.com/hypothesis/client/issues/531#issuecomment-463611460 for a new set of steps to reproduce.
Original report:
Originally reported by @heatherstaines on Slack (https://hypothes-is.slack.com/archives/C2BLQDKHA/p1504357779000060)
- Go to https://www.wired.com/story/harvey-evacuees-leave-their-belongings-and-health-records-behind?mbid=nl_090117_daily&CNDID=%%CUST_ID%%
- Activate the Hypothesis extension
- Select some text and click "Annotate"
Expected: New annotation created Actual: No annotation created, console error:
Uncaught URIError: URI malformed
at decodeURIComponent (<anonymous>)
at eval (eval at module.exports.e.uri (injector.bundle.js?8a864f:formatted:6787), <anonymous>:1:1)
at e.module.exports.e.uri (injector.bundle.js?8a864f:formatted:6787)
at e.uri (injector.bundle.js?8a864f:formatted:6735)
at e.module.exports.n.getDocumentInfo (injector.bundle.js?8a864f:formatted:5603)
at e.module.exports.n.createAnnotation (injector.bundle.js?8a864f:formatted:5870)
at Object.onAnnotate (injector.bundle.js?8a864f:formatted:5522)
at HTMLButtonElement.n (injector.bundle.js?8a864f:formatted:3850)
The URI passed to decodeURIComponent is https://www.wired.com/story/harvey-evacuees-leave-their-belongings-and-health-records-behind?mbid=nl_090117_daily&CNDID=%%CUST_ID%%, note the placeholder at the end. Passing this to decodeURIComponent results in an error.
Some additional context: The link came from an email that Wired sent out. The problematic part ('%%CUST_ID%%') is not part of the normal article link.
However, I use the Wired emails as my primary entry point to read the articles, and I've not had this problem before. Heather
On Sun, Sep 3, 2017 at 10:47 AM, Robert Knight [email protected] wrote:
Some additional context: The link came from an email that Wired sent out. The problematic part ('%%CUST_ID%%') is not part of the normal article link.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hypothesis/client/issues/531#issuecomment-326809425, or mute the thread https://github.com/notifications/unsubscribe-auth/AXoiF3V0OpTFKbTYfZNVSuMWZK_2HXNQks5serwLgaJpZM4PK8G0 .
-- Heather Ruland Staines Director, Partnerships Hypothes.is M: 203-400-1716 Skype: heather.staines
The Wired article is completely failing to load for me. However it is possible to trigger an issue by inserting %%CUST_ID%% into an arbitrary URL.
Steps to reproduce
- Go to https://example.com/?foo=%%CUST_ID%%
- Activate the embed
Expected: Client loads and annotations can be created. Actual: JS error reported in console and sidebar remains stuck in a "loading" state.
This has now been fixed. It can be tested by going to https://hypothes.is/docs/help?foo=%%CUST_ID%%, which embeds the latest version of the client.
This will be landing soon in the browser extension.