Command Code browser login leaks attempts in #attempts on failed start (post-merge P3 from #5395)

Open
#5,404 1 comment 0 reactions 1 assignee View on GitHub

@Totoro-qaq is already working on this.

Since Sep 17, 2026.

Assessment

This issue has not been assessed yet.

Description

bug

Follow-up to #5395 (merged as c34bbd6c).

Finding (P3, main regression): apps/desktop/src/main/commandcode-browser-login.ts:261 inserts the login attempt into the long-lived #attempts map before binding, but the port_unavailable, browser_unavailable, and bind-time superseded failure paths never return an attemptId. Those paths only call #finish(), which does not delete map entries; the only deletion point is complete(), unreachable from these paths.

Reproduction: a same-shape probe occupying the port shows the merged head retains 1000/1000 attempt sentinels after dispose() and forced GC, vs 0/1000 on the pre-merge head b317e597. Repeated failed starts therefore grow main-process memory.

Notes:

  • The 3xP2 pre-merge findings (connection probe false-positive, image wire shape, concurrent login) are all fixed in the merged head.
  • Detected during post-merge re-verification by @Haoqing_Reviewer; full evidence in PR #5395 review 5223843211 and inline 4027004632.

Automated review notice: This issue was filed by an AI review orchestrator operated by Astro-Han. It does not replace independent human review; merge/close decisions remain with humans.

Dominant language
TypeScript
Stars
5.6k
Forks
518
Avg merge
1d 3h
Merged PRs (30d)
684

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maka

All issues in apache/maka

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.