Skip to content

fix: correct hardcoded timestamps and wrong profile field name#580

Closed
thepastaclaw wants to merge 1 commit into
dashpay:v1.0-devfrom
thepastaclaw:fix/579-hardcoded-timestamps-and-bio-field
Closed

fix: correct hardcoded timestamps and wrong profile field name#580
thepastaclaw wants to merge 1 commit into
dashpay:v1.0-devfrom
thepastaclaw:fix/579-hardcoded-timestamps-and-bio-field

Conversation

@thepastaclaw
Copy link
Copy Markdown
Collaborator

Summary

Fixes two pre-existing bugs:

Bug 1: Hardcoded relative timestamps

Several UI locations displayed hardcoded strings instead of computing relative time from the actual timestamp data:

  • contact_requests.rs — "Received: 1 day ago" (incoming requests)
  • contact_requests.rs — "Sent: 2 days ago" (outgoing requests)
  • send_payment.rs — "2 days ago" (payment history)

Now uses chrono + chrono-humanize (already project dependencies) to compute human-readable relative timestamps from the timestamp field on ContactRequest and PaymentRecord structs. Handles both second-based timestamps (from the local database via unixepoch()) and millisecond-based timestamps (from DPP doc.created_at()). Falls back gracefully when the timestamp is zero or invalid.

Bug 2: Wrong profile field name

contacts.rs used .get("bio") to look up the public message field from the DashPay contract profile document. The correct field name is "publicMessage", which is consistent with every other usage in the codebase.

Fixes #579

- Compute relative timestamps from actual data instead of displaying
  hardcoded strings like "Received: 1 day ago"
- Fix profile field lookup from "bio" to "publicMessage" to match
  the DashPay contract schema

Fixes dashpay#579
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 16, 2026

Warning

Rate limit exceeded

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

⌛ 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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@thepastaclaw
Copy link
Copy Markdown
Collaborator Author

Split into two focused PRs per review feedback:

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.

fix: hardcoded timestamps and wrong profile field name in DashPay screens

1 participant