Repository navigation
feat(rest-api): [#2130] add peer updated-at timestamp - #2131
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2131 +/- ##
===========================================
- Coverage 84.05% 83.97% -0.09%
===========================================
Files 350 351 +1
Lines 27958 27988 +30
Branches 27958 27988 +30
===========================================
+ Hits 23501 23502 +1
- Misses 4063 4086 +23
- Partials 394 400 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The new #2130 issue spec metadata/tracking is internally inconsistent (status + implementation-plan task statuses) and should be corrected before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the v1 REST API peer contract to expose an explicit Peer.updated_at_ms absolute Unix-millisecond timestamp while keeping the two legacy timestamp fields for backwards compatibility, and it adds tests + docs to lock in the wire contract.
Changes:
- Add
updated_at_msto the v1Peerprotocol DTO and deprecateupdated_milliseconds_ago(while keepingupdateddeprecated). - Update the runtime adapter conversion to populate all three timestamp fields from the same domain timestamp, plus add focused conversion + raw JSON contract tests.
- Update v1 torrent endpoint documentation and add an issue specification file (replacing the previous draft).
File summaries
| File | Description |
|---|---|
| packages/rest-api-runtime-adapter/src/v1/conversion.rs | Maps updated_at_ms (and legacy fields) from the domain timestamp; adds conversion test coverage. |
| packages/rest-api-protocol/src/v1/context/torrent/resources/peer.rs | Extends v1 Peer DTO with updated_at_ms, updates deprecations/docs, and adds serde round-trip test. |
| packages/axum-rest-api-server/tests/server/v1/contract/context/torrent.rs | Adds raw JSON contract assertion that all three peer timestamp keys exist and are equal. |
| packages/axum-rest-api-server/src/v1/context/torrent/mod.rs | Updates the endpoint docs example and explains the timestamp semantics/migration direction. |
| docs/issues/open/2130-rename-peer-updated-milliseconds-ago-to-updated-at-ms/ISSUE.md | Adds the tracked issue spec and verification record for #2130. |
| docs/issues/drafts/144-rename-peer-updated-milliseconds-ago-to-updated-at-ms.md | Removes the superseded draft spec now that #2130 has an assigned open-issue folder. |
Review details
Suppressed comments (1)
docs/issues/open/2130-rename-peer-updated-milliseconds-ago-to-updated-at-ms/ISSUE.md:100
- The Implementation Plan table still marks all tasks as
TODO, but later sections (progress log + acceptance criteria) indicate the work is completed. Update these task statuses to avoid contradictory tracking information.
| T1 | TODO | Extend the v1 peer DTO | Add and document required `updated_at_ms`; deprecate the misleading legacy field with a migration note. |
| T2 | TODO | Map the domain timestamp | Update `from_domain_peer` so all three v1 timestamp fields equal `DurationSinceUnixEpoch::as_millis()`. |
| T3 | TODO | Protect the REST contract | Add independent conversion assertions and a raw endpoint JSON assertion for all three keys and equal values. |
| T4 | TODO | Update consumer-facing docs | Add `updated_at_ms` and accurate legacy-field semantics to the torrent endpoint example and API documentation. |
| T5 | TODO | Validate and review acceptance | Execute automatic and mandatory manual checks, then record acceptance evidence. |
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
ACK 3717471 |
Summary
Peer.updated_at_msabsolute Unix-millisecond timestamp.Validation
linter allCloses #2130