microsoft / microsoft/pxt-microbit

Switching projects sometimes loads the previous project code into the new one

Open
#6,524 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 reliability
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

We haven't found a way to constantly replicate this yet, but we have seen it multiple times now, so raising here for visibility and to check if other people have experienced it and could help us debug it or replicate it.

Essentially, when switching MakeCode projects, sometimes after going back and forth between screens that "hide" the blocks or code view (for example, going into the settings, extension search, etc), it sometimes seems to load the code from the previously opened project.
I have the feeling this only happens when moving around the MakeCode editor really quickly (so little time between opening a project and going into the other views, and then back into the code), but it's just an impression and might not be a trigger.

For example, the first time this happened to me I did something like this:

  • Open an old project with code
  • Created a new project
  • Loaded and extension
  • When the blocks view was shown again, instead of a blank project it had loaded the code from the old project

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

Start by reproducing the reported sequence in the MakeCode editor: open an old project, create a new one, load an extension, and switch between hidden code or blocks views. The issue is complete when the previous project's code no longer appears in the new project, with a reliable reproduction case or regression test if one can be established.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.