Implement following API routes #20

Closed
opened 2026-05-19 19:51:44 -05:00 by erik · 2 comments
Owner

Goal

Implement Slugkit following management routes without coupling API vocabulary to a specific social protocol.

Spec: docs/specs/09-following-routes.md

Requirements

  • Implement following list, resolve, follow, unfollow, and cancel routes from the spec.
  • Support following statuses pending, accepted, rejected, failed, and cancelled.
  • Resolve follow targets into profile URL, handle, display name, inbox URL, and avatar URL where available.
  • Create/update related contact/account data when following a target as documented by implementation behavior.
  • Handle delivery failures with clear shared errors or status records.
  • Return standardized 501 Not Implemented if following support is intentionally disabled.
  • Use shared auth, validation, not-found, conflict, and delivery-failure errors.
  • Document every route in OpenAPI with the operation IDs from the spec.
  • Add tests for target resolution, follow creation, list/status behavior, unfollow, cancel, auth, and OpenAPI coverage.

Acceptance criteria

  • Can list following records and statuses.
  • Can resolve a follow target.
  • Can follow a target and create a pending following record.
  • Can unfollow an accepted target.
  • Can cancel a pending follow.
  • Delivery/validation failures are visible and use documented error behavior.
  • Unsupported implementations return standardized 501 Not Implemented.
  • Every route appears in OpenAPI with documented operation IDs.
  • Relevant lint/test checks pass.

Dependencies

  • task-c272cbda
  • task-e8b46ccd
  • task-4efe743e
## Goal Implement Slugkit following management routes without coupling API vocabulary to a specific social protocol. Spec: `docs/specs/09-following-routes.md` ## Requirements - Implement following list, resolve, follow, unfollow, and cancel routes from the spec. - Support following statuses `pending`, `accepted`, `rejected`, `failed`, and `cancelled`. - Resolve follow targets into profile URL, handle, display name, inbox URL, and avatar URL where available. - Create/update related contact/account data when following a target as documented by implementation behavior. - Handle delivery failures with clear shared errors or status records. - Return standardized `501 Not Implemented` if following support is intentionally disabled. - Use shared auth, validation, not-found, conflict, and delivery-failure errors. - Document every route in OpenAPI with the operation IDs from the spec. - Add tests for target resolution, follow creation, list/status behavior, unfollow, cancel, auth, and OpenAPI coverage. ## Acceptance criteria - [ ] Can list following records and statuses. - [ ] Can resolve a follow target. - [ ] Can follow a target and create a pending following record. - [ ] Can unfollow an accepted target. - [ ] Can cancel a pending follow. - [ ] Delivery/validation failures are visible and use documented error behavior. - [ ] Unsupported implementations return standardized `501 Not Implemented`. - [ ] Every route appears in OpenAPI with documented operation IDs. - [ ] Relevant lint/test checks pass. ## Dependencies - task-c272cbda - task-e8b46ccd - task-4efe743e
Collaborator

Synced from todu comment by @todu on 2026-05-31T03:57:51.532Z

Review update

  • PR: #76
  • Result: approved
  • Verification: make check, ./scripts/pre-pr.sh, and Forgejo CI CI / build-lint-test (pull_request) passed.
  • Acceptance criteria: 9/9 met.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-05-31T03:57:51.532Z_ ### Review update - PR: https://forge.caradoc.com/erik/slugkit/pulls/76 - Result: approved - Verification: `make check`, `./scripts/pre-pr.sh`, and Forgejo CI `CI / build-lint-test (pull_request)` passed. - Acceptance criteria: 9/9 met. - Follow-up: waiting for explicit human merge approval.
caradoc 2026-05-30 23:05:43 -05:00
Collaborator

Synced from todu comment by @todu on 2026-05-31T04:01:08.643Z

Completed

  • Implemented authenticated following management API routes: list, resolve, create, unfollow, and cancel.
  • Added protocol-neutral following persistence with statuses pending, accepted, rejected, failed, and cancelled.
  • Added deterministic follow-target resolution for URL and handle-like targets into profile URL, handle, display name, inbox URL, and avatar URL.
  • Added contact/account creation or reuse when following a target.
  • Added visible validation, conflict, not-found, failed-status/lastError, and standardized 501 Not Implemented behavior.
  • Documented all following routes in OpenAPI with operation IDs following.list, following.resolve, following.create, following.unfollow, and following.cancel.
  • Added tests for auth, resolution, create/list/status, unfollow, cancel, error behavior, unsupported behavior, OpenAPI coverage, and migration coverage.
  • Verified with make check, ./scripts/pre-pr.sh, and passing Forgejo CI.
  • Merged PR #76 into main.
_Synced from todu comment by @todu on 2026-05-31T04:01:08.643Z_ ### Completed - Implemented authenticated following management API routes: list, resolve, create, unfollow, and cancel. - Added protocol-neutral `following` persistence with statuses `pending`, `accepted`, `rejected`, `failed`, and `cancelled`. - Added deterministic follow-target resolution for URL and handle-like targets into profile URL, handle, display name, inbox URL, and avatar URL. - Added contact/account creation or reuse when following a target. - Added visible validation, conflict, not-found, failed-status/`lastError`, and standardized `501 Not Implemented` behavior. - Documented all following routes in OpenAPI with operation IDs `following.list`, `following.resolve`, `following.create`, `following.unfollow`, and `following.cancel`. - Added tests for auth, resolution, create/list/status, unfollow, cancel, error behavior, unsupported behavior, OpenAPI coverage, and migration coverage. - Verified with `make check`, `./scripts/pre-pr.sh`, and passing Forgejo CI. - Merged PR #76 into `main`.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#20
No description provided.