codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Editing own Next.js sandbox files when not signed in modifies original and creates a fork

Open aboqasem opened this issue 3 years ago • 1 comments

🐛 bug report

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Description of the problem

Editing a file of your own Next.js sandbox while not signed in and saving the file prompts you to sign in and fork the sandbox. Signing in forks it and redirects you to the fork. Going to the original sandbox show an unsaved change in that file that contains your change prior to forking.

How has this issue affected you? What are you trying to accomplish?

Modifying the package.json of my sandbox without noticing that I'm signed out.

To Reproduce

  1. Sign out
  2. Visit a Next.js sandbox that you own
  3. Change something
  4. Try to save
  5. Click the "Sign in" button when prompted to fork
  6. You'll be redirected to a forked sandbox. Visit the original one
  7. See the file changed (not saved when I tried with package.json, but saved when tried with a normal file)

Link to sandbox: N/A (optional)

Your Environment

Software Name/Version
Сodesandbox Website
Browser Brave/1.38.111 Chromium: 101.0.4951.54 (Official Build) (x86_64)
Operating System macOS Monterey/12.3.1

aboqasem avatar May 08 '22 12:05 aboqasem

Hey @aboqasem ,

Thank you for the feedback, this is occurring as you're following the 'fork' prompt which means that once you sign in, CodeSandbox is following the previous request (and so creates the fork for you).

There are definitely ways we can improve the user experience here though, so thank you for flagging this!

JamesACS avatar May 10 '22 08:05 JamesACS