[stable32] fix: iappconfig cache sync#6237
Merged
vitormattos merged 3 commits intostable32from Dec 18, 2025
Merged
Conversation
IAppConfig uses per-process cache, causing race conditions when CLI commands and HTTP requests execute simultaneously during Behat tests. The CLI generates a ca_id, but HTTP requests see an empty cache and generate a different ca_id, overwriting the CLI value. Solution: - Detect debug mode (automatically set during Behat tests) - Apply file lock + cache clear workaround only in debug mode - Production code remains unchanged for optimal performance This fix resolves test failures in features/sign/request.feature:28 and features/sign/request.feature:61 where setup validation was failing due to mismatched certificate paths. Signed-off-by: Vitor Mattos <[email protected]>
When getCaId() finds an empty CA ID in cache, it now calls clearCache(true) to reload from database before generating a new one. This prevents race conditions in test environments where CLI commands and HTTP requests may execute simultaneously with independent caches. The solution is simpler than using file locks and works transparently in both test and production environments with minimal overhead. Signed-off-by: Vitor Mattos <[email protected]>
Replace 'libresign:configure:openssl --cn test' CLI commands with HTTP POST requests to '/apps/libresign/api/v1/admin/certificate/openssl' in integration tests to prevent race conditions between CLI and HTTP processes during test execution. This ensures all certificate setup happens via HTTP requests, avoiding IAppConfig cache synchronization issues that can occur when mixing CLI commands with HTTP requests in the same test scenario. Signed-off-by: Vitor Mattos <[email protected]> [skip ci]
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.
Backport of #6234
Warning, This backport had conflicts that were resolved with the⚠️
oursmerge strategy and is likely incompleteTodo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.