codesandbox-client
codesandbox-client copied to clipboard
Editing own Next.js sandbox files when not signed in modifies original and creates a fork
🐛 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
- Sign out
- Visit a Next.js sandbox that you own
- Change something
- Try to save
- Click the "Sign in" button when prompted to fork
- You'll be redirected to a forked sandbox. Visit the original one
- 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 |
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!