client icon indicating copy to clipboard operation
client copied to clipboard

Invalid text quote selector causes whole page to be highlighted

Open robertknight opened this issue 8 years ago • 4 comments

Steps to reproduce

  1. Visit https://hyp.is/BvFJGPmpRd-7d6g7_sOpFg/web.hypothes.is or create an annotation via the API which has a similar quote selector to the JSON below.

Expected behaviour

The annotation should fail to anchor.

Actual behaviour

The annotation anchors to the whole page.

Additional details

The annotation has an invalid quote selector:

{
  "updated": "2015-06-03T04:15:51.304541+00:00",
  "group": "__world__",
  "target": [
    {
      "source": "https://web.hypothes.is",
      "selector": [
        {
          "type": "TextPositionSelector",
          "end": null,
          "start": null
        },
        {
          "exact": null,
          "prefix": null,
          "type": "TextQuoteSelector",
          "suffix": null
        }
      ]
    }
  ],
  "links": {
    "json": "https://hypothes.is/api/annotations/BvFJGPmpRd-7d6g7_sOpFg",
    "html": "https://hypothes.is/a/BvFJGPmpRd-7d6g7_sOpFg",
    "incontext": "https://hyp.is/BvFJGPmpRd-7d6g7_sOpFg/web.hypothes.is"
  },
  "tags": [],
  "text": "testing create in hypothes.is API",
  "created": "2015-06-03T04:15:51.304523+00:00",
  "uri": "https://web.hypothes.is",
  "flagged": false,
  "user": "acct:[email protected]",
  "hidden": false,
  "document": {
    "title": [
      "Annotating the law | Hypothes.is"
    ]
  },
  "consumer": "00000000-0000-0000-0000-000000000000",
  "id": "BvFJGPmpRd-7d6g7_sOpFg",
  "permissions": {
    "read": [
      "group:__world__"
    ],
    "admin": [
      "acct:[email protected]"
    ],
    "update": [
      "acct:[email protected]"
    ],
    "delete": [
      "acct:[email protected]"
    ]
  }
}

robertknight avatar May 26 '17 21:05 robertknight

@robertknight - in your opinion, is this a bug, or technical debt that needs to be fixed?

klemay avatar Mar 16 '18 18:03 klemay

This is a bug.

robertknight avatar Mar 16 '18 18:03 robertknight

Moved back to "To Review" on bug backlog because we're unclear whether this is still a valid bug. If a developer could try to reproduce & let us know if the issue persists, that would be helpful.

klemay avatar Nov 10 '20 19:11 klemay

That annotation still exists but doesn't get loaded by the client at all when visiting the page https://web.hypothes.is. I've confirmed that it doesn't appear on https://web.hypothes.is/blog/annotating-the-law/ (which is the page on the website whose title matches that in the annotation) and doesn't appear if you're logged into the Hypothesis moderation user account (hypmod).

We'll need to create a new test case to try and reproduce.

robertknight avatar Dec 16 '20 19:12 robertknight

I'm closing this issue since it hasn't come up recently and can't be reproduced from the original steps.

robertknight avatar Jan 03 '23 13:01 robertknight