Repository navigation
Marlin SD: refresh the list after a delete - #463
Merged
Merged
Conversation
The delete query ended on the first plain "ok". The default delete command is "M21;M30 #", so the ok of M21 (or of a polling command) arrived before "File deleted" and the query ended as "end without start", which is reported as an error. The list was then not refreshed. End the query on "File deleted" instead.
A missing card or an unknown M21/M30 now ends the delete query at once as an error instead of after the 30 s timeout, using the same messages the list query already checks. The Files panel refreshes the list after every delete or createdir result, also on errors and timeouts, so it always shows what is on the card.
Owner
|
Merged - thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting a file from the Marlin SD list in the Files panel deletes it on the card, but the list isn't refreshed, and an error toast can appear even though the delete worked.
Cause
The SD delete query ends on the first plain
ok. The default delete command isM21;M30 #, so theokofM21(or of a polling command such asM105;M114;M27) arrives beforeFile deleted. The processor then sees "end without start", reports an error, and the success branch that refreshes the list never runs.Changes
Printer3D/Marlin/SD-source.js: the delete query ends onFile deleted, which is Marlin's fixed serial message (it isn't translated). BesidesDeletion failed, a missing card (echo:No SD card,echo:No media) or an unknownM21/M30now ends it at once as an error instead of after the 30 s timeout. These are the same messages the list query already checks.Panels/Files.js: the list is refreshed after every delete or createdir result, errors and timeouts included, so it always shows what is on the card.dist/is not rebuilt in this PR.Testing
On an Ender-3 Pro (SKR Mini E3 V3.0, Marlin bugfix-2.1.x) through ESP3D 3.1.3 on an ESP32-C3, with polling enabled: deleting a file from the SD list removes it from the list within about 2 s, with no error toast. Before the change, the list kept the file until a manual Refresh.
npm run printer-marlinbuilds.