You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I visit /repl, new repl is created, user is redirected to their unique REPL url /repl/123, and user is given edit token in localStorage.
When on a REPL url /repl/123, and user with token starts editing, status bar says "You have unsaved changes." Button in title bar says "Save". When clicked, REPL is updated and message clears.
When on a REPL url /repl/123, and user without token starts editing, status bar says "You have unsaved changes." Button in title bar says "Fork and save". When clicked, new REPL is created, user redirected to new URL /repl/456, and message clears.
The text was updated successfully, but these errors were encountered:
We don't want to create a new sandbox on the server whenever someone visits /repl, so we're going to generate the ids on the client and only create one on the server once they hit Save. Therefore the client will always need to send over the ID when creating a sandbox.
When I visit /repl, URL stays /repl. User starts typing and sees message "You have unsaved changes."
When on a /repl with unsaved changes, user can click Save which uses a clientside generated id (so we can make pretty ids), a clientside generated editing token, and a clientside generated browser_id. It sends this over along with the data and creates a sandbox on server. User is redirected to /repl/abc. User's editing token and browser_id is saved in localStorage.
When visiting a REPL url /repl/abc, user fetches sandbox from server with all data except for editing token. (Editing token is hidden from reads). User starts editing and status bar changes to "You have unsaved changes."
If user's localStorage.browser_id matches repl.browser_id, Button in title bar says "Save". When clicked, REPL is updated and message clears. (Backend verifies editing token matches).
If user doesn't have repl.browser_id (either different or blank), Button in title bar says "Fork and save". When clicked, client generates new REPL data (id, editing token, maybe browser_id if they don't already have one) and creates new REPL on server. User redirected to new URL /repl/def and message clears.
/repl
, new repl is created, user is redirected to their unique REPL url/repl/123
, and user is given edit token in localStorage./repl/123
, and user with token starts editing, status bar says "You have unsaved changes." Button in title bar says "Save". When clicked, REPL is updated and message clears./repl/123
, and user without token starts editing, status bar says "You have unsaved changes." Button in title bar says "Fork and save". When clicked, new REPL is created, user redirected to new URL/repl/456
, and message clears.The text was updated successfully, but these errors were encountered: