Repository navigation
fix: handle concurrent first module configuration writes - #132
Merged
Merged
Conversation
Refs #11 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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.
Refs #11
Two authorized actors configuring the same previously unset module could both observe an absent flag and race to insert it. The unique constraint prevented duplicates but the losing HTTP request returned 500. Recover only from a unique-constraint violation when the exact workspace/module row now exists; revalidate capability and module discovery before updating that row. Preserve unrelated database failures and the effective parent-policy restriction.
Evidence: a real installed Nextcloud PostgreSQL reproduction returned HTTP 200/500 on the second concurrent pair, with SQLSTATE 23505 on lf_m_space_id. After the correction, the same focused integration suite passed 97/97 assertions on each of PostgreSQL, SQLite and MariaDB (291 total, 36 concurrent pairs). It verifies both requests succeed, disabled reports are denied, re-enable works and a separate workspace remains unaffected. PHP and shell syntax, diff checks and REUSE passed. The test is now part of the canonical integration matrix, including core-only runs. Full hosted CI and review remain pending. No migrations, frontend bundles or external financial actions are included.