Add the shareable ID to a notebook's URL on the first time it is shared #243
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This PR introduces the shareable URL as a URL parameter to the notebook URL when it first connects to the sharing service (on manual shares). As with other instances, we use
window.history.replaceStateto modify the URL without reloading the page. This guarantees that if an authored notebook is reloaded, the shareable link in the URL will still enable users to access a view-only version, from which they can create another copy and retain their work. To generate a new notebook, students will need manually remove the URL parameter themselves. As discussed, since the save interval is thirty seconds, there is a slight chance that changes made between these intervals might not be saved, but I would emphasise that we are already doing our best to prevent data loss through other methods (toast notifications, handlingbeforeUnloadevents, etc.).Currently, this cannot be reliably tested until I complete #73, so I've skipped adding a test. However, I have tested this locally.
As discussed internally, this is slightly orthogonal to the sharing token being persisted using a cookie or the notebook content being saved to a cookie with an extremely short expiration time.
Closes #104.