Reverse subscription flow #2

Merged
glyph merged 2 commits from reverse_subscription_flow into main 2022-08-22 15:25:59 +00:00
Owner

Previously we added a peer to the database before successfully completing an sbot follow and removed a peer from the database before successfully completing an unfollow.

This PR reverses the order:

When a subscription event is received via the UI:

  1. Check the follow status
  2. Follow if not following
  3. Add peer to database

When an unsubscription event is received via the UI:

  1. Check the follow status
  2. Unfollow if following
  3. Remove peer from database

Both follow_if_not_following() and unfollow_if_following() now return Result<(), String> so we can match on the result in src/routes.rs.

Previously we added a peer to the database before successfully completing an sbot follow and removed a peer from the database before successfully completing an unfollow. This PR reverses the order: When a subscription event is received via the UI: 1. Check the follow status 2. Follow if not following 3. Add peer to database When an unsubscription event is received via the UI: 1. Check the follow status 2. Unfollow if following 3. Remove peer from database Both `follow_if_not_following()` and `unfollow_if_following()` now return `Result<(), String>` so we can match on the result in `src/routes.rs`.
glyph added 2 commits 2022-08-22 15:25:53 +00:00
glyph merged commit fcce647711 into main 2022-08-22 15:25:59 +00:00
glyph deleted branch reverse_subscription_flow 2022-08-22 15:25:59 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 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: glyph/lykin#2
No description provided.