Check for subscriber calendar ownership when creating calendar records #1463
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.
Description of the Change
Before, we were only creating calendar records if it hasn't been created yet, otherwise we were just updating. The lookup for whether or not it had been created was only based on the
calendar_urlitself.Bug flow:
google_url_a) with X, Y and Z calendars. This succeeds since it is the first time thatgoogle_url_ais used.google_url_a), except that when we try to create the calendar records, we see thatgoogle_url_ais already there, therefore we attempt to update the calendars instead.Now we are also checking for calendar ownership so that calendar records are created if they don't exist for a subscriber (even if the
calendar_urlis the same).How to test
Prerequisites:
AUTH_SCHEME=oidcyou will need access to whichever Keycloak instance you are connecting to and have two users set up there!docker compose down -vanddocker compose up -d --buildBenefits
Applicable Issues
Fixes #1458