codesandbox / codesandbox/codesandbox-client

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

Open
#6,681 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🐛 bug report

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project
    adheres to.
  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the reproduction steps with an owned Next.js sandbox while signed out, then trace the save, sign-in, and fork flow. Pay particular attention to the package.json case and a normal file, and verify that saving does not alter the original sandbox before the fork; confirm the resulting fork still receives the intended change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js
Domain
authentication, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.