Skip to content

fix(files): stale state in fileTree#2030

Closed
UnschooledGamer wants to merge 8 commits intomainfrom
UnschooledGamer-patch-3
Closed

fix(files): stale state in fileTree#2030
UnschooledGamer wants to merge 8 commits intomainfrom
UnschooledGamer-patch-3

Conversation

@UnschooledGamer
Copy link
Copy Markdown
Member

This commit attempts to fix the stale files state issue occuring from Internal State of fileTree.

regression: to be found, how it occurred recently.

This commit attempts to fix the stale files state issue occuring from Internal State of fileTree. 

regression: to be found, how it occurred recently.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

This PR correctly addresses the prior review feedback: $parent is now captured before $target.remove(), removeEntry (not removeEntity) is called, and await is present. However, the new removeEntryFromFileTree function still contains a leftover fragment from an earlier draft — lines 1070-1082 outside the function body include a stray } that causes a module-level SyntaxError, completely breaking openFolder.js at parse time.

Confidence Score: 2/5

  • Not safe to merge — module-level SyntaxError breaks all file operations in the app.
  • The orphaned } at line 1082 is an unmatched closing brace at module scope, causing a parse-time SyntaxError that prevents the entire openFolder.js module from loading. This is a P0 regression introduced by this PR that must be fixed before merging.
  • src/lib/openFolder.js — specifically lines 1070-1082 (orphaned block outside removeEntryFromFileTree).

Important Files Changed

Filename Overview
src/lib/openFolder.js Implements removeEntryFromFileTree and captures $parent before DOM removal — logic is sound, but a leftover orphaned code block (lines 1070-1082) containing a stray } causes a module-level SyntaxError that prevents the entire file from loading.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[deleteFile called] --> B{helpers.isFile?}
    B -- yes --> C[capture $parent = $target.parentElement]
    C --> D[$target.remove]
    D --> E[update editorManager]
    B -- no --> F[delete dir recursively]
    F --> G[capture $parent = $target.parentElement?.parentElement]
    G --> H[$target.parentElement.remove]
    H --> I[update editorManager]
    E --> J[toast + FileList.remove]
    I --> J
    J --> K[await removeEntryFromFileTree url,$parent]
    K --> L{$parent._fileTree exists?}
    L -- yes --> M[fileTree.removeEntry url]
    L -- no --> N[no-op, legacy tile already removed]
    M --> O[Done]
    N --> O

    style K fill:#f96,stroke:#c33
    note1[Lines 1070-1082: orphaned block\nstray closing brace causes SyntaxError]
    K -.->|broken by parse error| note1
Loading

Reviews (2): Last reviewed commit: "Update openFolder.js" | Re-trigger Greptile

UnschooledGamer and others added 4 commits April 14, 2026 09:22
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@UnschooledGamer
Copy link
Copy Markdown
Member Author

@greptileai

UnschooledGamer and others added 2 commits April 14, 2026 10:27
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@UnschooledGamer UnschooledGamer added community CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. labels Apr 14, 2026
@github-actions github-actions bot removed the CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. label Apr 14, 2026
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

Preview Release for this, has been built.

Click here to view that github actions build

@UnschooledGamer
Copy link
Copy Markdown
Member Author

UnschooledGamer commented Apr 14, 2026

This has been superseded by #2031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant