Implementation proposal: /outbox?view=latest API
#2331
Jiwoon-Kim
started this conversation in
General
Replies: 1 comment 5 replies
-
|
What do you want to achieve with that? The outbox and inbox are also used by Client Apps, so we might need to have the full stream, for them to get all changes!? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
#2309
Implementation proposal:
/outbox?view=latestAPI“Preserve all activities internally, but separate the external display so that only the latest state is exposed.”
In other words, maintain the full internal event log while providing a compacted Outbox view that only shows the most recent state of each object by default.
💡 Proposed Design Options
1) Event Log + “Latest State View” API (Recommended)
object.uri.GET /outbox?view=latestor/outbox/latestthat returns only the most recent Activity per object.✅ Pros: Preserves original logs while improving network efficiency.
⚠️ Cons: Must ensure referential integrity for Undo/Delete relationships.
2) Periodic Outbox Compaction Job
outbox:public, show only the most recentactivity.urifor eachobject.uri.Implementation Example (WordPress ActivityPub Plugin)
Add
object_uriindex to theactivitiestable.Continue storing all Activities (Create, Update, Delete, Undo, etc.).
Add a function
get_outbox_latest(limit, page)that:object_uriRun a background job
compact_outbox()that flags older items asarchived.Use
get_outbox_latest()for the default Outbox output and federation delivery.?full_history=trueto show the complete event log.This approach doesn’t delete data — it’s primarily a UX and performance optimization.
It’s safer to first implement delivery-time deduplication, and later extend it with periodic Outbox compaction if needed.
Optionally, provide an admin setting to toggle between “Full History” and “Latest Only” modes for flexibility.
Beta Was this translation helpful? Give feedback.
All reactions