fix: concurrency issue when saving records #72
Merged
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.
I don't have high hopes for this fix but it was suggested here and I can't completely ignore the similiarity in how odd this is: https://learn.microsoft.com/en-us/answers/questions/1186074/database-update-insert-fails So we shouldn't have the possibility of concurrency issues here because we are simply inserting everything. Worse case scenario we would end up with double entries for the same ban. Yet for some reason it seems to think we're modifying entries when we're supposed to be inserting them. As such it's reasonable to assume swapping the state to added (despite the fact that the "AddRange" method is supposed to do that for us) might resolve the issue. Again, I'm not entirely hopeful but I'm willing to try. Since the issue is intermittent we have to test in prod.