fix: POST /v1/user/subscriptions overwrites current subscriptions - #1791
Draft
davidgamez wants to merge 1 commit into
Draft
fix: POST /v1/user/subscriptions overwrites current subscriptions#1791davidgamez wants to merge 1 commit into
davidgamez wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This pull request significantly changes how feed-scoped notification subscriptions are handled in the user service. Previously, creating a feed-scoped subscription would replace the set of feeds for an existing subscription; now, each create call generates a new subscription, and each feed can only be targeted by one subscription per user and notification type. Attempts to subscribe a feed already covered by an existing subscription are rejected with a 400 error, both via an application-level pre-check and a database constraint. The tests and documentation have been updated to reflect this new behavior.
Feed-scoped subscription logic changes:
_feeds_already_subscribed) to preemptively reject requests targeting feeds already subscribed for the same notification type, and mapped database uniqueness violations (from concurrent creates) to a 400 error instead of a 500. [1] [2] [3]Test updates and new tests:
Documentation updates:
Expected behavior:
Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).
Testing tips:
Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything