1. 19 Nov, 2019 4 commits
  2. 18 Nov, 2019 19 commits
  3. 15 Nov, 2019 5 commits
  4. 14 Nov, 2019 1 commit
    • Lyza Danger Gardner's avatar
      Prevent errors arising from applying private permissions to anonymous annotations · 8ca4773b
      Lyza Danger Gardner authored
      As a convenience, the app retains the last permissions level used by a user when publishing an annotation. For example, if a user creates and saves and annotation that is set to “only me”/private, the app stashes that as a pseudo-preference in `localStorage` and the next time a user creates a new annotation, that will be the default permissions level applied to it. This makes it easier to create several subsequent annotations that have the same permissions/sharing setting.
      
      There is a bug in this approach, however, which before this patch happened when:
      
      * A Hypothesis user creates an annotation and sets the permissions to “private” (only me) and saves the annotation successfully to the `h` service, then;
      * The Hypothesis user logs out, then;
      * The same person in the same browser (now an anonymous user from Hypothesis’ perspective) selects some text and clicks “annotate., then;
      * The user is shown an error message that they must log in to create annotations: they click “Log In”
      
      Before this fix, the user then would see an error “Cannot read property ‘split’ of null” in an error flash and the login process would not successfully complete. The only workaround was to reload the browser window and try again.
      
      After this fix, the user will not see an error after the sequence detailed above and the login process will complete.
      
      This fix is achieved by preventing the app from attempting to apply default permissions of “only me”/private when no `userid` is available. Doing so creates corrupted permissions on the annotation which throw `TypeError`s when later iterated over.
      
      There are several further fixes necessary to fully clean up this situation, but this patches over the immediate user-visible bug.
      
      Fixes https://github.com/hypothesis/client/issues/1221
      8ca4773b
  5. 13 Nov, 2019 3 commits
  6. 12 Nov, 2019 7 commits
  7. 11 Nov, 2019 1 commit