Skip to content

fix(desktop): settle command request lifecycle - #2810

Open
HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/desktop-request-record-cleanup
Open

HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/desktop-request-record-cleanup

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue was found.

Summary

Desktop command responses with suppressed error codes returned before removing their request records. Native bridge failures, a missing or synchronously failing bridge, and aborts also left timers or records behind. This change centralizes tracked request settlement so every terminal path clears its timer, removes its record, settles the Promise once, and ignores duplicate late responses.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • yarn test:desktop-request-settlement: passed.
    • Targeted ESLint for commandLine, useAbortRequest, lifecycle helper, and tests: passed.
    • Community Umi/Webpack build: succeeded.
    • Production bundle verifier: passed.
    • git diff --check origin/main...HEAD: passed.
  • Manual verification: N/A - in-memory registry tests cover timers, suppressed errors, native rejection, abort-compatible rejection, cleanup exceptions, and late responses.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: No external API or persisted-state changes.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: No new data flow; error payloads and notification policy are preserved.
  • Community / Local / Pro boundary: Shared Community desktop request bridge.
  • Backward compatibility: Successful and ordinary failed responses keep their existing order; previously hanging terminal paths now reject and clean up.

Reviewer map

  • Start here: requestSettlement.ts, then commandLineRequest/pushMessageFlow and useAbortRequest.
  • Failure condition: a terminal response leaves a timer or store record, rejects twice, reports a suppressed error, or a late response reclaims the request.
  • Rollback or disable path: Revert commit 0c169bb; no migration is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, automated tests, verification, and adversarial review.

Latest-main revalidation (2026-09-04)

  • Rebased as one commit onto upstream 144a04e; current head 0c169bb.
  • All 7 deterministic request-settlement scenarios passed, including interceptor failure rejection and cleanup.
  • Targeted ESLint passed.
  • Full Community prebuild suite, Umi/Webpack production build, and bundle verifier passed.

@HandSonic
HandSonic requested review from a team and openai0229 as code owners August 30, 2026 06:32
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 30, 2026
@HandSonic
HandSonic force-pushed the fix/desktop-request-record-cleanup branch from 65fc32b to 0c169bb Compare September 3, 2026 20:21
Align existing OtterMind/Chat2DB PR OtterMind#2810, retaining its focused behavior and current Community contracts.

This branch has not been deployed

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants