Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Pybricks Beta does not overwrite existing file on import if requested to overwrite #975

Closed
BertLindeman opened this issue Mar 9, 2023 · 4 comments
Assignees
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application

Comments

@BertLindeman
Copy link

BertLindeman commented Mar 9, 2023

Describe the bug
Import of file already existing in beta.pybricks.com neatly shows dialog.
But a press on the red replace button does not cause the imported file to be really loaded.

To reproduce

In beta.pybricks.com add a new program:

print("original program")

Save the program in Z:\home\bert\py\pybricks\issue
as try_overwrite.py

Update the program in beta.pybricks.com like this:

print("original program")
print("after save: updated")

Now import the original saved program.

dialog shows:
afbeelding

Press the red replace button.
No error shown.

Close try_overwrite.py in the active tab and
re-open try_overwrite.py and see still the updated source, not the original saved one (as was saved).

Screenshot:
afbeelding

Expected behavior
See newly imported version of source.

Environment
Pybricks v3.3.0b2 (Pybricks Beta v2.2.0-beta.1)
Windows 11 Ver 22H2
Microsoft Edge Version 110.0.1587.63 (Official build) (64-bit)

EDIT: typo (still wrong in description "exsisting")

@BertLindeman BertLindeman added the triage Issues that have not been triaged yet label Mar 9, 2023
@BertLindeman
Copy link
Author

Huh??

If I set and unset the "remember" flag on the dialog and then press the red replace button, then the replace works.

If I do not touch the "remember" flag on the dialog, the replace is not done, each time.
No message seen in developers console.

@dlech dlech added bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application and removed triage Issues that have not been triaged yet labels Mar 9, 2023
@BertLindeman
Copy link
Author

If the program is open as programming tab then the replace also does not work
regardless op the remember flag.
(hope this is a bit understandable jargon)

@dlech dlech changed the title [Bug] code.pybricks.com does not overwrite exsisting file on import if requested to overwrite [Bug] code.pybricks.com does not overwrite existing file on import if requested to overwrite May 17, 2023
@dlech dlech changed the title [Bug] code.pybricks.com does not overwrite existing file on import if requested to overwrite [Bug] Pybricks Beta does not overwrite existing file on import if requested to overwrite May 17, 2023
dlech added a commit to pybricks/pybricks-code that referenced this issue May 18, 2023
When we import/replace a file that is open in an editor, instead of
modifying the file in storage, we need to modify the file in the editor.
This allows the modification to be pushed on the undo stack so that
the user can undo the change in case it wrote over any of their recent
changes.

Issue: pybricks/support#975
@dlech dlech self-assigned this May 18, 2023
dlech added a commit to pybricks/pybricks-code that referenced this issue May 18, 2023
When we import/replace a file that is open in an editor, instead of
modifying the file in storage, we need to modify the file in the editor.
This allows the modification to be pushed on the undo stack so that
the user can undo the change in case it wrote over any of their recent
changes.

Issue: pybricks/support#975
@dlech
Copy link
Member

dlech commented Jun 2, 2023

I think I got this fixed in Pybricks Code v2.2.0-beta.5. At least the case replacing a file that is open in the editor. Let us know if you still have other issues with this.

@BertLindeman
Copy link
Author

Works for me.
If asking to overwrite, file is overwritten like requested, regardless the remember-flag.
First tested if open in the editor.
Also if the file is NOT open in the editor, all goes as expected, too.

I am just not sure that the remember flag is indeed remembered.
But this issue has been solved at Pybricks Code v2.2.0-beta.5.

And not related but good to see copied from the status bar:

Connected to: spikeBeta
Hub type: Prime hub
Firmware: v3.3.0b5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application
Projects
None yet
Development

No branches or pull requests

2 participants