Conversation
Coverage Report for CI Build 24428392141Coverage decreased (-0.2%) to 84.136%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
payjoin-cli/src/app/v2/mod.rs
Outdated
| error_message: Option<String>, | ||
| } | ||
|
|
||
| fn format_timestamps(value: &str) -> String { |
There was a problem hiding this comment.
Can we have sqlite do this fromatting? https://stackoverflow.com/questions/33114055/how-to-convert-timestamp-to-string-in-sqlite#33114085
There was a problem hiding this comment.
After attempting this , it worked well for completed at since thats stored in a column in db. but for the status field, when its expired its still a unix seconds because that's constructed entirely by rust without hitting the db layer.
Session ID Sender/Receiver Completed At Status
1 Receiver 2025-10-24 18:38:06 Session expired at Time(Time(1760095762))
2 Receiver 2025-10-24 18:38:06 Session expired at Time(Time(1760120713))
3 Receiver 2025-10-24 18:38:06 Session expired at Time(Time(1760126437))
4 Receiver 2025-10-24 18:38:06 Session expired at Time(Time(1760126556))
5 Receiver 2025-10-09 20:09:17 Session expired at Time(Time(1760126869))
6 Receiver 2025-10-24 18:38:06 Session expired at Time(Time(1760196351))
However if a session is yet to expire , the status field becomes
21 Receiver Not Completed Waiting for original proposal
1 Receiver 2025-10-24 18:38:06 Session expired at 2025-10-10 11:29:22 UTC
2 Receiver 2025-10-24 18:38:06 Session expired at 2025-10-10 18:25:13 UTC
one way i could solve this without an external dep is to implement display for Time struct in payjoin-core and then use something like the civil-from-days algorithm by Howard Hinnant (saw this via a google search) to derive the current time
There was a problem hiding this comment.
Ah pure rust construction makes it a little trickier. I doubt this is a payjoin-core change though, if there's no way to display depending on sqlite if anything you'd want to implement that algo to display in payjoin-cli.
DanGould
left a comment
There was a problem hiding this comment.
I also prefer sqlite formatting if we already have it over adding the chrono dependency.
This Pr addresses payjoin#1472. When the session history is displayed the timestmap isn't in readable form. This Pr changes the time from unix seconds into proper human readbale date/time.
This Pr addresses #1472. When the session history is displayed the timestmap isn't in readable form.
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.