Skip to content

fix: unwrap getToken IPC result + use exact range for auto-link paste#240

Merged
github-actions[bot] merged 1 commit into
developfrom
fix/codex-review-p2-findings
Apr 24, 2026
Merged

fix: unwrap getToken IPC result + use exact range for auto-link paste#240
github-actions[bot] merged 1 commit into
developfrom
fix/codex-review-p2-findings

Conversation

@tomymaritano

Copy link
Copy Markdown
Collaborator

Summary

Fixes two P2 findings from Codex review on PR #238.

  • localServer.getToken() type mismatch — IPC handler returns { ok, value } but preload declared Promise<string> and passed the raw object through. Any caller would send Bearer [object Object]. Now unwraps value in preload and throws on error.
  • Auto-link paste rewrites wrong URLindexOf() could match an earlier duplicate URL in the document. Now tracks the exact insert position (from/to) and verifies the text at that range still matches before replacing with the markdown link.

Test plan

  • pnpm typecheck — clean
  • pnpm test — all pass
  • Manual: paste a URL in the editor, verify auto-link replaces the correct occurrence

🤖 Generated with Claude Code

P2-1: localServer.getToken() returned the raw IPC result { ok, value }
instead of unwrapping it to a string. Any caller would send
"Bearer [object Object]" as auth. Now unwraps value in preload.

P2-2: Auto-link paste used indexOf() to find the URL after async title
fetch, which could match an earlier duplicate URL. Now tracks the
exact insert position and verifies the text at that range still
matches before replacing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
readide Building Building Preview, Comment Apr 24, 2026 4:47pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@tomymaritano has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 43 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1d3ecc58-1b86-4a1c-b78c-ba38e3ee30f8

📥 Commits

Reviewing files that changed from the base of the PR and between 0514398 and 6357bdc.

📒 Files selected for processing (2)
  • apps/desktop/src/preload/api/localServer.ts
  • apps/desktop/src/renderer/components/MarkdownEditor.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codex-review-p2-findings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot enabled auto-merge (squash) April 24, 2026 16:47
@github-actions github-actions Bot merged commit 32f522a into develop Apr 24, 2026
13 of 15 checks passed
tomymaritano added a commit that referenced this pull request Apr 24, 2026
## Summary

- **fix(mcp-server):** non-destructive FTS5 check + switch search to
FTS5 MATCH (#241)
- **fix:** unwrap getToken IPC result + use exact range for auto-link
paste (#240)
- **fix:** gate built-in plugins until enabled state loads + fix IPC
listener cleanup (#239)
- **feat:** allow disabling built-in plugins + fix MCP server FTS5 crash
(#237)
- **chore(deps):** sync postcss bump from main

## Test plan
- [ ] CI passes (typecheck, lint, tests, build)
- [ ] After merge, run Release workflow via `workflow_dispatch`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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