fix: correct hardcoded timestamps and wrong profile field name#580
fix: correct hardcoded timestamps and wrong profile field name#580thepastaclaw wants to merge 1 commit into
Conversation
- 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
|
Warning Rate limit exceeded
⌛ 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. ✨ 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 |
|
Split into two focused PRs per review feedback:
|
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 thetimestampfield onContactRequestandPaymentRecordstructs. Handles both second-based timestamps (from the local database viaunixepoch()) and millisecond-based timestamps (from DPPdoc.created_at()). Falls back gracefully when the timestamp is zero or invalid.Bug 2: Wrong profile field name
contacts.rsused.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