Emit accept actions for follows#18
Conversation
Assisted-by: Codex:gpt-5.5
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesReceivedFollow → Accept action flow
Sequence Diagram(s)sequenceDiagram
participant Caller
participant FederCore
participant FederState
participant Actions as Vec<Action>
Caller->>FederCore: handle(Input::ReceivedFollow { follow, accept_id })
FederCore->>FederState: record_follow(ReceivedFollow { follow, accept_id })
FederState->>Actions: push StoreFollower(follower, following)
alt actor has embedded inbox
FederState->>Actions: upsert delivery_targets entry
FederState->>Actions: push SendActivity(Accept { id: accept_id, object: follow })
else actor ID only
FederState->>FederState: skip SendActivity
end
FederState-->>FederCore: Vec<Action>
FederCore-->>Caller: HandleResult::new(actions)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 684a2f9684
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| actions.push(Action::StoreFollower(StoreFollower { | ||
| follower: follow.actor.clone(), | ||
| following: follow.object.clone(), | ||
| })); |
There was a problem hiding this comment.
Normalize the stored follow target
When a remote Follow targets Alice with an embedded Actor object whose id matches local_actor but whose other fields are attacker-controlled, the in-memory follower relation is normalized by ID, but this persistence action still forwards that embedded local actor object to the runtime. Since StoreFollower is the action a runtime will use to persist the relationship, this can cache or overwrite bogus local-actor data; record_created_note already avoids the same trust issue by emitting the configured local actor ID. Use Reference::id(self.local_actor.id.clone()) for following here.
Useful? React with 👍 / 👎.
Summary
Implements the Phase 1 Follow -> Accept core flow for
feder-core.This changes
Input::ReceivedFollowto carry runtime-provided data needed by the core:FollowAcceptactivity ID to use when an accept can be emittedWhen a valid Follow targets the configured local actor, core now returns actions for the runtime:
Action::StoreFollowerAction::SendActivity(Activity::Accept(...))when a follower inbox is already knownDesign Notes
The core still performs no HTTP, storage, fetching, signing, delivery, clock reads, or ID generation.
A first-time ID-only Follow records/stores the follower but does not emit
SendActivity(Accept), because the core does not know the follower inbox and actor fetching is out of scope. Accept delivery is emitted when the follower actor is embedded or when the inbox is already known from core state.This keeps actor resolution as a future runtime/core boundary concern instead of pulling I/O into
feder-core.Validation
cargo fmt --checkcargo test -p feder-coremise run checkRefs #8
Summary by CodeRabbit
Bug Fixes