1. 29 Sep, 2023 2 commits
  2. 28 Sep, 2023 13 commits
  3. 27 Sep, 2023 4 commits
  4. 25 Sep, 2023 11 commits
  5. 19 Sep, 2023 3 commits
    • Robert Knight's avatar
      Support error responses to requests for a message channel · b1c25bca
      Robert Knight authored
      Allow the host frame to explicitly reject a request for a message channel by
      setting the `Message.error` property. Previously other frames could only wait
      for requests to time out. This allows the sidebar to display an error much
      sooner if it gets reloaded and cannot reconnect to the host frame.
      
      Part of https://github.com/hypothesis/client/issues/4095
      b1c25bca
    • Robert Knight's avatar
      Remove strict checks on source/target frame roles · d58567d0
      Robert Knight authored
      These checks had not been updated for the addition of the "profile" application.
      Also at a conceptual level the responsibility for deciding which types of frames
      are allowed to connect to each other belongs to the `PortProvider` in the host
      frame, not the `PortFinder` in other frames.
      d58567d0
    • Robert Knight's avatar
      Handle sidebar iframe reloads more gracefully · fcf87072
      Robert Knight authored
      If the `<hypothesis-sidebar>` element is moved around in the DOM, this can cause
      the sidebar to reload. There may also be other causes of the sidebar reloading
      (eg. process crash for out-of-process iframe?). If the sidebar loads a second
      time, it will fail to connect to the host frame since `PortProvider` will try to
      re-use the `MessageChannel` it has already allocated, but sending that channels
      ports will fail since they have already been transferred.
      
      Recovering from this scenario fully involves a lot of changes since all the
      places that have a connection to the sidebar would need to support replacing
      that channel. Also various state in host/guest frames (eg. currently loaded
      annotations) will be out of sync and need resetting.
      
      What this commit does is just to handle the situation more gracefully, by
      logging a meaningful error in the console and, after a delay, showing an error
      message in the sidebar telling the user to reload the page. This also avoids
      spamming Sentry [1] with errors about a situation that is out of our control. We
      get a lot of error reports about this each month, mainly from certain
      high-traffic pages that embed the client, but so far no actual complaints from
      users about Hypothesis not working. Therefore it doesn't yet seem valuable
      enough to do all the work to recover from a sidebar frame reload automatically.
      
      [1] https://hypothesis.sentry.io/issues/2975780063/
      fcf87072
  6. 18 Sep, 2023 7 commits