feat: limit plugin installation load#1951
Merged
RohitKushvaha01 merged 2 commits intoAcode-Foundation:mainfrom Mar 17, 2026
Merged
feat: limit plugin installation load#1951RohitKushvaha01 merged 2 commits intoAcode-Foundation:mainfrom
RohitKushvaha01 merged 2 commits intoAcode-Foundation:mainfrom
Conversation
Contributor
Greptile SummaryThis PR addresses excessive concurrent I/O during plugin installation by replacing the original "fire all files in parallel" approach ( Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[installPlugin called] --> B[Download plugin ZIP]
B --> C[Parse plugin.json & resolve deps]
C --> D[files = Object.keys zip.files\nlimit = 2]
D --> E{i < files.length?}
E -- Yes --> F[batch = files.slice i, i+limit]
F --> G[Promise.allSettled batch.map processFile]
G --> H[await setTimeout 0\nYield to UI thread]
H --> I[i += limit]
I --> E
E -- No --> J{ignoredUnsafeEntries.size > 0?}
J -- Yes --> K[Show warning in loaderDialog]
J -- No --> L[loadPlugin / depsLoaders]
K --> L
L --> M[state.save\ndeleteRedundantFiles]
subgraph processFile [processFile per entry]
P1[Normalize path] --> P2{isUnsafeAbsolutePath?}
P2 -- Yes --> P3[Add to ignoredUnsafeEntries, return]
P2 -- No --> P4[sanitizeZipPath]
P4 --> P5{isDirEntry?}
P5 -- Yes --> P6[createFileRecursive dir]
P5 -- No --> P7[Ensure parent dir exists]
P7 --> P8[Read ArrayBuffer from entry]
P8 --> P9{state.isUpdated?}
P9 -- No --> P10[Skip write, return]
P9 -- Yes --> P11[writeFile to pluginDir]
end
Last reviewed commit: 1c4bf36 |
bajrangCoder
approved these changes
Mar 16, 2026
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.
#1803