fix(files): uri encode node source#61494
Open
leftybournes wants to merge 1 commit into
Open
Conversation
Signed-off-by: Kent Delante <kent@delante.me> Node sources that aren't url-encoded are compared against their url-encoded counterparts. Ensure that both are url-encoded so that a fair comparison is made. This fixes an issue with files lists still showing a .md file in the list after deleting it in the editor.
4cc986d to
e50f4ea
Compare
susnux
reviewed
Jun 22, 2026
| function deleteNodes(nodes: INode[]) { | ||
| const entries = Object.entries(files.value) | ||
| .filter(([, node]) => !nodes.some((n) => n.source === node.source)) | ||
| .filter(([, node]) => !nodes.some((n) => n.source === encodeURI(node.source))) |
Contributor
There was a problem hiding this comment.
Why should there be ever a case of uri-encoded source? The source has to be not URI encoded.
If you need the URI encoded source, use node.encodedSource.
IF there are cases with URI encoded source, then those cases need to be fixed.
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.
Summary
Node sources that aren't url-encoded are compared against their url-encoded counterparts. Ensure that both are url-encoded so that a fair comparison is made. This fixes an issue with files lists still showing a .md file in the list after deleting it in the editor.
Checklist
3. to review, feature component)stable32)AI (if applicable)