Skip to content

Reject duplicate same-app install and update requests - #95

Open
kitsuyui wants to merge 1 commit into
mainfrom
fix/audit-install-task-same-id-request-overwrite-001
Open

Reject duplicate same-app install and update requests#95
kitsuyui wants to merge 1 commit into
mainfrom
fix/audit-install-task-same-id-request-overwrite-001

Conversation

@kitsuyui

Copy link
Copy Markdown
Owner

Summary

  • reject duplicate install or update requests for the same app before they overwrite the queued task slot
  • surface ignored duplicate requests with a warning snackbar and an IPC observation event
  • add regression coverage for duplicate requests that arrive while the first task is queued or already running

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

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.
@github-actions

Copy link
Copy Markdown

gh-counter

PR gate

Removed Added +/-
TODO/FIXME 0 0 0
Type escape 0 0 0
Lint suppression 0 0 0
Electron webPreferences risk 0 0 0

Repo dashboard

main (acd0f79) #95 (d828146) +/-
TODO/FIXME 0 0 0
Type escape 1 1 0
Lint suppression 30 30 0
Electron webPreferences risk 0 0 0

Reported by gh-counter

@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (acd0f79) #95 (d828146) +/-
Coverage 46.6% 47.0% +0.3%
Code to Test Ratio 1:0.3 1:0.3 +0.0
Test Execution Time 7s 5s -2s
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%)

Files Coverage +/- Status
main-src/libs/ipc/listener-handlers.ts 100.0% 0.0% modified

Reported by octocov

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant