Skip to content

fix: proper disposable lifecycle for hint animation timer in UpdateTitleBarEntry#304890

Draft
Copilot wants to merge 2 commits intoeli/update-stylingfrom
copilot/fix-github-actions-workflow-please-work
Draft

fix: proper disposable lifecycle for hint animation timer in UpdateTitleBarEntry#304890
Copilot wants to merge 2 commits intoeli/update-stylingfrom
copilot/fix-github-actions-workflow-please-work

Conversation

Copy link
Contributor

Copilot AI commented Mar 25, 2026

The hintTimer field in UpdateTitleBarEntry was a raw setTimeout handle that was never cleared on disposal, violating VS Code's disposable lifecycle contract.

Changes in updateTitleBarEntry.ts:

  • Replace hintTimer: ReturnType<typeof setTimeout> with private readonly _hintTimer = this._register(new MutableDisposable())
  • Use disposableTimeout + dom.scheduleAtNextAnimationFrame (both IDisposable) inside a DisposableStore so cancelling _hintTimer atomically cancels all pending work — outer timeout, animation frame, and inner 3-second timeout
  • Construct the DisposableStore and add all pending work before assigning to _hintTimer.value
  • Simplify onStateChange cleanup to this._hintTimer.clear()
  • Capture content as a local variable inside the callback to eliminate the ! non-null assertion on this.content

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/microsoft/vscode/actions/jobs/68598610686/logs
    • Triggering command: /usr/bin/gh gh api repos/microsoft/vscode/actions/jobs/68598610686/logs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix the failing GitHub Actions workflow "Code OSS / Linux / Browser (pull_request)".
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 68598610686
Job URL: /microsoft/vscode/actions/runs/23560432186/job/68598610686?pr=304877


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…itleBarEntry

The `hintTimer` was a raw `setTimeout` handle that was not registered as a
disposable, violating VS Code's disposable lifecycle guidelines. When the
`UpdateTitleBarEntry` was disposed, the timer would still fire and access
DOM elements.

Fix:
- Replace raw `hintTimer` with `_hintTimer = this._register(new MutableDisposable())`
- Use `disposableTimeout` and `dom.scheduleAtNextAnimationFrame` (both IDisposable)
- Use a `DisposableStore` so cancelling clears all pending work atomically
- Simplify `onStateChange` to use `this._hintTimer.clear()`
- Capture `content` locally to avoid non-null assertions in async callbacks

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/ce23b534-a19a-4201-bae8-e5cf73b11c3c

Co-authored-by: eli-w-king <201316543+eli-w-king@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow for Code OSS fix: proper disposable lifecycle for hint animation timer in UpdateTitleBarEntry Mar 25, 2026
Copilot AI requested a review from eli-w-king March 25, 2026 20:25
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.

2 participants