Skip to content

P1B: Refactor (packages/desktop/src/main/debug.ts): Complex binary expression - #89

Open
mrmarri1 wants to merge 1 commit into
CMU-17313Q:mainfrom
mrmarri1:fix-readDocumentNodeId
Open

mrmarri1 wants to merge 1 commit into
CMU-17313Q:mainfrom
mrmarri1:fix-readDocumentNodeId

Conversation

@mrmarri1

@mrmarri1 mrmarri1 commented Sep 5, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #87

Type of change

  • Bug fix
  • New feature
  • [x ] Refactor / code improvement
  • Documentation

What does this PR do?

Refactors response validation in packages/desktop/src/main/debug.ts.

The original readDocumentNodeId check used one long conditional to validate the debugger response. I split the object validation into requireRecord, then validate root.nodeId separately. This keeps the same invalid-response error behavior while removing the Qlty complex binary expression reported at line 71.

I also added tests for invalid document responses and invalid node ID responses.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

image coverage including debug.ts image after qlty test showing removal of issue i focused on image bun lint test
  • bun lint packages/desktop/src/main/debug.ts packages/desktop/src/main/debug.test.ts
    • 0 warnings, 0 errors
  • bun test --coverage --coverage-dir=./coverage from packages/desktop
    • 74 passed, 0 failed
    • Coverage includes src/main/debug.ts
  • bun typecheck from packages/desktop
    • passed
  • Re-ran Qlty on packages/desktop/src/main/debug.ts
    • The claimed line-71 smell is removed.
      bun lint from the repository root still reports unrelated existing errors outside these files.

Checklist

  • [ x] I have tested my changes locally
  • [ x] I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@mrmarri1 mrmarri1 changed the title P1B: Starter Task: Refactoring P1B: Refactor (packages/desktop/src/main/debug.ts): Complex binary expression Sep 5, 2026
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.

P1B: Refactor (packages/desktop/src/main/debug.ts:71): Complex binary expression

1 participant