fix(dashpay): read label instead of normalizedLabel and use records.identity in profile search#822
Conversation
…dentity in profile search normalizedLabel returns homograph-converted names (o→0, i/l→1) to the UI. owner_id() returns the original registrant after name transfers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
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 4 minutes and 46 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughUpdated the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Review GateCommit:
|
There was a problem hiding this comment.
Pull request overview
Fixes DashPay profile search result correctness by ensuring usernames are displayed in their human-readable form and that identity IDs are resolved from the authoritative DPNS field.
Changes:
- Use
label(notnormalizedLabel) for displayed usernames in profile search results. - Resolve the identity ID from
records.identity(notowner_id()) to handle DPNS name transfers correctly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Centralizes the duplicated DPNS document -> identity ID extraction pattern into model::dpns::extract_identity_id_from_dpns_document(). Used by profile search, contact requests, and identity-by-name lookup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Fixes two bugs in
search_profiles()(src/backend_task/dashpay/profile.rs) that were missed by PR #810's DPNS fixes.Bug 1:
normalizedLabeldisplayed instead oflabelThe profile search reads
normalizedLabelfrom DPNS documents to build display names.normalizedLabelapplies DPNS homograph-safe conversions (o→0,i/l→1+ lowercase), so users see mangled names:"alice"→ displayed as"a11ce.dash""olivia22"→ displayed as"011v1a22.dash"Fix: Read
labelinstead — the original human-readable username.Bug 2:
owner_id()instead ofrecords.identitySame bug fixed in
contact_requests.rsby PR #810, but missed here. After a DPNS name transfer,document.owner_id()still points to the original registrant.records.identityis the authoritative reference for the current owner.Fix: Extract identity ID from
records.identityusing the sameValue::Mappattern established incontact_requests.rs. Documents missingrecords.identityare silently skipped.Test plan
o,i, orl— verify the display name shows the original characters, not homograph replacementscargo clippy --all-features --all-targets -- -D warningsclean🤖 Co-authored by Claudius the Magnificent AI Agent
Summary by CodeRabbit
Bug Fixes