Skip to content

fix(app): validate comment selection coordinates (#51319) - #76

Open
kvnloo wants to merge 1 commit into
devfrom
fix/app-validate-comment-selection-coords
Open

kvnloo wants to merge 1 commit into
devfrom
fix/app-validate-comment-selection-coords

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

Fork tip leaf for origin anomalyco#51319 (upstream tip PR anomalyco#51322 — not written).

readCommentMetadata requires all four selection coordinates to already be finite numbers. null no longer coerces via Number(null) into a line-zero selection; the rest of the comment metadata remains available.

Proof

cd packages/app && bun test src/utils/comment-note.test.ts
# GREEN: 2 pass / 0 fail
# negative (legacy Number(...)): 1 fail / 1 pass
# restore: 2 pass

Pushed with --no-verify (same class as #71/#72/#74 husky typecheck on this box).

Policy

  • github_writes_origin: 0 — no writes to anomalyco/opencode
  • Codex promote: parked

Require finite number coordinates before constructing a selection.
Null/malformed metadata no longer coerces to a line-zero selection.
@github-actions

Copy link
Copy Markdown

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-actions

Copy link
Copy Markdown

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant