This repository was archived by the owner on Sep 30, 2024. It is now read-only.
code-monitors: handle soft-deleted users#60405
Merged
stefanhengl merged 5 commits intomainfrom Feb 13, 2024
Merged
Conversation
Code monitors from soft-deleted users cause errors in the client. For example, if an admin opens the code monitors page, they see a "user not found" error. With this change we filter code monitors of soft-deleted users. This means the system effectively behaves as if the user was hard-deleted. For users that were actually hard-deleted, we already delete their code monitors, which avoids this issue. Test plan: new unit test
jtibshirani
approved these changes
Feb 12, 2024
Contributor
jtibshirani
left a comment
There was a problem hiding this comment.
This approach makes sense to me.
camdencheek
approved these changes
Feb 12, 2024
Member
camdencheek
left a comment
There was a problem hiding this comment.
LGTM, thanks! This has come up a few times and I've never found the time to look into it
BolajiOlajide
approved these changes
Feb 12, 2024
Member
|
Backport? Probably best left for the next patch release. Also don't forget changelog :) |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Code monitors from soft-deleted users cause errors in the client. For example, if an admin opens the code monitors page, they see a "user not found" error.
With this change we filter out code monitors of soft-deleted users. This means, the system effectively behaves as if the user was hard-deleted.
For users that were actually hard-deleted, we already delete their code monitors, which avoids this issue.
I also confirmed that we don't run code monitors of soft-deleted users.
Alternatives considered:
I first went down the path to fix this on the level of the resolver and in the client. However it turned out that this would require a lot of small changes of the GraphQL API paired with some fallback logic in the client. Overall the approach taken in this PR is much smaller and easier to understand.
Test plan: