Skip to content

fix: handle concurrent first module configuration writes - #132

Merged
vitormattos merged 1 commit into
mainfrom
fix/concurrent-module-configuration-11
Nov 25, 2026
Merged

vitormattos merged 1 commit into
mainfrom
fix/concurrent-module-configuration-11

Conversation

@vitormattos

Copy link
Copy Markdown
Member

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.

Refs #11

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos merged commit 1ff6530 into main Nov 25, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant