Skip to content

fix(dashpay): read label instead of normalizedLabel and use records.identity in profile search#822

Merged
lklimek merged 2 commits into
v1.0-devfrom
fix/profile-search-label
Apr 9, 2026
Merged

fix(dashpay): read label instead of normalizedLabel and use records.identity in profile search#822
lklimek merged 2 commits into
v1.0-devfrom
fix/profile-search-label

Conversation

@lklimek
Copy link
Copy Markdown
Contributor

@lklimek lklimek commented Apr 9, 2026

Summary

Fixes two bugs in search_profiles() (src/backend_task/dashpay/profile.rs) that were missed by PR #810's DPNS fixes.

Bug 1: normalizedLabel displayed instead of label

The profile search reads normalizedLabel from DPNS documents to build display names. normalizedLabel applies DPNS homograph-safe conversions (o0, i/l1 + lowercase), so users see mangled names:

  • "alice" → displayed as "a11ce.dash"
  • "olivia22" → displayed as "011v1a22.dash"

Fix: Read label instead — the original human-readable username.

Bug 2: owner_id() instead of records.identity

Same bug fixed in contact_requests.rs by PR #810, but missed here. After a DPNS name transfer, document.owner_id() still points to the original registrant. records.identity is the authoritative reference for the current owner.

Fix: Extract identity ID from records.identity using the same Value::Map pattern established in contact_requests.rs. Documents missing records.identity are silently skipped.

Test plan

  • Search for a username containing o, i, or l — verify the display name shows the original characters, not homograph replacements
  • cargo clippy --all-features --all-targets -- -D warnings clean

🤖 Co-authored by Claudius the Magnificent AI Agent

Summary by CodeRabbit

Bug Fixes

  • Fixed profile search functionality to correctly extract and display identity information and usernames from updated data structures in profile documents.

…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>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@lklimek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 46 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 4 minutes and 46 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: CHILL

Plan: Pro

Run ID: 5ef43012-e901-4965-8371-90ce70a7e20e

📥 Commits

Reviewing files that changed from the base of the PR and between 75f4a81 and a3ef6c6.

📒 Files selected for processing (4)
  • src/backend_task/dashpay/contact_requests.rs
  • src/backend_task/dashpay/profile.rs
  • src/backend_task/identity/load_identity_by_dpns_name.rs
  • src/model/dpns.rs
📝 Walkthrough

Walkthrough

Updated the search_profiles function to derive identity_id from the records map within a document instead of using owner_id(), and changed username lookup to reference the label field instead of normalizedLabel, with fallback to identity_id if unavailable.

Changes

Cohort / File(s) Summary
Profile Search Logic
src/backend_task/dashpay/profile.rs
Modified search_profiles to extract identity_id from document records map (locating "identity" key and converting Value::Identifier) instead of calling owner_id(). Updated username lookup to use label field with .dash formatting and fallback behavior; DPNS results are skipped if identity_id derivation fails.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through records, searching with care,
From normalizedLabel to label everywhere,
Identity unlocked from the maps that we hold,
Each document's secrets now gracefully told!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main fixes: reading label instead of normalizedLabel and using records.identity in profile search, matching the core changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/profile-search-label

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.

@lklimek lklimek requested a review from Copilot April 9, 2026 13:12
@lklimek lklimek marked this pull request as ready for review April 9, 2026 13:13
@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented Apr 9, 2026

Review Gate

Commit: a3ef6c6c

  • Debounce: 1m ago (need 30m)

  • CI checks: checks still running (2 pending)

  • CodeRabbit review: comment found

  • Off-peak hours: peak window (5am-11am PT) — currently 06:39 AM PT Thursday

  • Run review now (check to override)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (not normalizedLabel) for displayed usernames in profile search results.
  • Resolve the identity ID from records.identity (not owner_id()) to handle DPNS name transfers correctly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/backend_task/dashpay/profile.rs Outdated
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>
@lklimek lklimek enabled auto-merge (squash) April 9, 2026 13:39
@lklimek lklimek merged commit 7e03205 into v1.0-dev Apr 9, 2026
5 checks passed
@lklimek lklimek deleted the fix/profile-search-label branch April 9, 2026 13:46
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.

3 participants