Skip to content

feat(social): make follow operations idempotent (BA-052) - #1036

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-052-idempotent-follow-965
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-052-idempotent-follow-965

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR addresses issue #965 (BA-052) by ensuring repeated follow requests do not create duplicate relationships or modify existing timestamps.

  • Changes:
    • BackendAcademy/src/social/dto/follow.dto.ts: Added Swagger documentation to FollowDto.
    • BackendAcademy/src/social/follow.service.ts: Added support for both parameter signatures and DTO objects in follow and unfollow, ensuring repeated follow operations are fully idempotent without side-effects or duplicate edges.
    • BackendAcademy/src/social/follow.service.spec.ts: Added comprehensive unit test coverage verifying that repeated follow requests preserve edge uniqueness, counts, and existing timestamps, along with idempotent unfollow behavior.
  • Verification:
    • All 18 tests in follow.service.spec.ts pass cleanly (100% Green).
    • Scope strictly restricted to the 3 allowlisted files.

Closes #965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BA-052 — Make follow operations idempotent

1 participant