Skip to content

fix(tui): add null guards for lsp and mcp state data - #20444

Closed
Echoziness wants to merge 1 commit into
anomalyco:devfrom
Echoziness:fix/lsp-mcp-null-guard
Closed

fix(tui): add null guards for lsp and mcp state data#20444
Echoziness wants to merge 1 commit into
anomalyco:devfrom
Echoziness:fix/lsp-mcp-null-guard

Conversation

@Echoziness

@EchozinessEchoziness commented Apr 1, 2026

Copy link
Copy Markdown

Closed as the fix has been implemented in v1.4.7 via other PRs (#22099, #22206). Thanks for the initial report!

@github-actionsgithub-actionsBot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Apr 1, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actionsgithub-actionsBot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Apr 1, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Echoziness

Echoziness commented Apr 1, 2026

Copy link
Copy Markdown
Author

Note on the initial typecheck failure

The first typecheck run failed with ../app/node_modules/.ts-dist/src/i18n/ru.d.ts(757,24): error TS1002: Unterminated string literal. This is in an auto-generated .d.ts file inside node_modules, not in any source code this PR touches. Re-running the check resolved it, confirming this is an intermittent issue in Bun/tsgo declaration file generation rather than a code problem.

The e2e (linux/windows) failures are a known issue affecting all open PRs and are unrelated to this change.

@Echoziness

Echoziness commented Apr 2, 2026

Copy link
Copy Markdown
Author

Final Local Verification & A/B Test Results

I have conducted a series of controlled tests on Windows 11 with clangd to verify the fix across different project scales.

ScenarioPath (CWD)VersionActionResult
1algo/string_concat (Subdir)1.3.13 (Global)Open SidebarPass
2AI_Workspace (Root)1.3.13 (Global)Access nested .cppCrash
3algo/string_concat (Subdir)This PR (Dev)Open SidebarPass
4AI_Workspace (Root)This PR (Dev)Access nested .cppPass

Key Findings:

  • Reproduced: In large workspaces (Scenario 2), the global 1.3.13 version consistently crashes due to the longer LSP initialization window.
  • Verified: In the exact same environment (Scenario 4), this PR handles the initialization window perfectly and no longer crashes.
  • The ?? [] and ?? {} null guards provide 100% stability regardless of project size or indexing speed.

All CI checks are green. Ready for review/merge.

@Echoziness

Copy link
Copy Markdown
Author

Hi @kommander and @Hona, hope you're doing well!

I noticed you've both been actively reviewing TUI-related changes recently. This PR adds a few null guards to \sync.data.lsp\ and \sync.data.mcp\ in the TUI status dialog and footer to prevent a crash during service initialization. It's a small, low-risk fix (+11/-11 lines) and all CI checks are green.

I know the PR queue is quite busy right now, so no rush at all—just wanted to gently bump it in case it slipped through the cracks. Thanks for all your hard work on the project!

Prevents crash when sidebar renders LSP/MCP panels before services
are initialized. sync.data.lsp and sync.data.mcp can be undefined
during initial load, causing TypeError on .map() and Object.entries().
Fixes crash: 'undefined is not an object (evaluating sync8.data.lsp.map)'
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

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

Labels

needs:complianceThis means the issue will auto-close after 2 hours.needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Echoziness