Reject duplicate same-app install and update requests - #95
Open
kitsuyui wants to merge 1 commit into
Open
Conversation
Avoid overwriting the queued task slot when the same app is requested more than once. Duplicate install or update requests are now rejected with a warning snackbar and observation event, and regression tests cover both queued and running duplicate requests.
gh-counterPR gate
Repo dashboard
Reported by gh-counter |
Code Metrics Report
Details | | main (acd0f79) | #95 (d828146) | +/- |
|---------------------|----------------|---------------|-------|
+ | Coverage | 46.6% | 47.0% | +0.3% |
| Files | 151 | 151 | 0 |
| Lines | 2677 | 2695 | +18 |
+ | Covered | 1250 | 1268 | +18 |
+ | Code to Test Ratio | 1:0.3 | 1:0.3 | +0.0 |
| Code | 14484 | 14651 | +167 |
+ | Test | 4896 | 5011 | +115 |
+ | Test Execution Time | 7s | 5s | -2s |Code coverage of files in pull request scope (100.0% → 100.0%)
Reported by octocov |
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
Why
Repeated requests for the same app reused a single mutable
taskMap[id]slot. A later request could replace the queued closure for an earlier request, and the earlier queued slot would then execute the wrong closure or no-op after cleanup. This change makes the second request explicit instead of silently dropping it.Impact
Users now keep the original in-flight request and receive immediate feedback when they try to enqueue the same app again. Queue ordering stays predictable because same-app duplicates no longer overwrite the pending task entry.
Verification
./node_modules/.bin/biome check main-src/libs/ipc/listener-handlers.ts main-src/libs/ipc/listener-handlers.test.ts./node_modules/.bin/vitest run main-src/libs/ipc/listener-handlers.test.ts