Fix/nostr quote reference display - #142
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughNostr comment mapping now removes resolved quoted-event references from displayed text while preserving unrelated or unresolved references. Tests cover all three cases and verify that resolved quotes still populate ChangesQuote reference display handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ec7bb4460
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| private fun displayContent(note: NostrNote): String { | ||
| val quotedEventId = note.quotedNote?.event?.id ?: return note.content |
There was a problem hiding this comment.
Strip the reference after deferred quote resolution
When the quoted note is not cached, this returns the original content because quotedNote is null. The later resolution path in NostrCommentUpdateStream.applyNote (lines 223–225) only assigns sharedComment and never remaps the parent text, so the emitted update permanently displays both the raw nostr: reference and the resolved embedded quote. The stripping logic must also run when that deferred quote is attached.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
nostr/src/commonTest/kotlin/work/socialhub/planetlink/nostr/action/NostrMapperTest.kt (1)
15-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for
note1references.All three tests use
nevent1, while the production regex also supportsnote1. Add at least one resolved-quote test using anostr:note1...reference to prevent regressions in that path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nostr/src/commonTest/kotlin/work/socialhub/planetlink/nostr/action/NostrMapperTest.kt` around lines 15 - 72, Add a resolved-quote test alongside removesResolvedQuoteReferenceFromDisplayText using a nostr:note1 reference instead of nevent1, with the quoted event resolved, and assert the reference is removed while the remaining display text and sharedComment behavior stay consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@nostr/src/commonMain/kotlin/work/socialhub/planetlink/nostr/action/NostrMapper.kt`:
- Around line 29-31: Update NOSTR_EVENT_REFERENCE to use case-insensitive
matching, then normalize matched NIP-19 event references to lowercase before
passing them to Nip21.extractEventIds. Preserve valid all-lowercase and
all-uppercase presentations while rejecting mixed-case input, and add regression
coverage for uppercase and mixed-case normalization in the relevant NostrMapper
tests.
---
Nitpick comments:
In
`@nostr/src/commonTest/kotlin/work/socialhub/planetlink/nostr/action/NostrMapperTest.kt`:
- Around line 15-72: Add a resolved-quote test alongside
removesResolvedQuoteReferenceFromDisplayText using a nostr:note1 reference
instead of nevent1, with the quoted event resolved, and assert the reference is
removed while the remaining display text and sharedComment behavior stay
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 90c4d202-ae9f-46e6-96ec-a9ed4843bcec
📒 Files selected for processing (2)
nostr/src/commonMain/kotlin/work/socialhub/planetlink/nostr/action/NostrMapper.ktnostr/src/commonTest/kotlin/work/socialhub/planetlink/nostr/action/NostrMapperTest.kt
🤖 PR Review Auto-CheckLast checked: 2026-07-24 12:01 UTC No new review comments since the last check. What was doneSummaryWhat I fixed
What I intentionally skipped
Commits pushed3 commits to
|
Summary by CodeRabbit
Bug Fixes
Tests