fix: server workflow API TOCTOU races and misc issues #355
Merged
pradeeban merged 1 commit intoControlCore-Project:devfrom Mar 1, 2026
Merged
fix: server workflow API TOCTOU races and misc issues #355pradeeban merged 1 commit intoControlCore-Project:devfrom
pradeeban merged 1 commit intoControlCore-Project:devfrom
Conversation
Author
|
Hey @pradeeban @mayureshkothare found this while writing the tests, get_random_string is still a method on the class but it doesn't use self at all, could just be a module-level function. not blocking anything but might be worth cleaning up separately. lmk if you have any suggestions and guidance, thanks :p |
Member
|
@avinxshKD ok, pls clean that up separately. |
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.
Closes #354
insert and update were doing read-then-write as separate ops so two concurrent saves could silently clobber each other. Switched both to find_one_and_update with the hash in the filter (atomic), added a unique index on serverID so the insert retry loop is also race-free, swapped
randomfor secrets, addedMAX_CONTENT_LENGTH, fixed bareexcept:, and added POST tests since there were none.All tests are passing (4+ 5 new test)