Repository navigation
[19.0][FIX] server_environment: keep sibling env fields cache consistent - #306
Open
Ricardoalso wants to merge 1 commit into
Open
Ricardoalso wants to merge 1 commit into
Ricardoalso wants to merge 1 commit into
Conversation
Ricardoalso
marked this pull request as draft
October 1, 2026 11:29
Ricardoalso
force-pushed
the
19.0-fix-server_environment-sibling-cache
branch
from
October 1, 2026 11:48
be4b8e7 to
0326f18
Compare
Ricardoalso
force-pushed
the
19.0-fix-server_environment-sibling-cache
branch
3 times, most recently
from
October 28, 2026 15:46
4b00c57 to
4cc8ca5
Compare
Env-computed fields share `_compute_server_env` and have no field dependency. While one of them is written, the ORM protects all of them against recomputation, so a constraint reading a sibling env field that is not in cache gets an empty value: it raises spuriously or is silently skipped (e.g. webservice OAuth2 checks seeing `auth_type` as False). Before running constraints, compute the protected env fields missing from cache from the configuration or their stored default. The fields being written are left alone: if evicted from cache, the ORM writes them again before their inverse, and filling them from the defaults would lose their new values. This is also why it is not done in the inverse. As env fields are now cached on create and write, the test helper `load_config` invalidates the cache when switching the configuration, otherwise dependent modules' tests read the previous values.
Ricardoalso
force-pushed
the
19.0-fix-server_environment-sibling-cache
branch
from
October 28, 2026 15:53
4cc8ca5 to
33f5113
Compare
Ricardoalso
marked this pull request as ready for review
October 28, 2026 16:08
Contributor
Author
|
Hi @rven, I made some changes in here. It should be ready now |
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.
Env-computed fields share
_compute_server_envand have no fielddependency. While one of them is written, the ORM protects all of them
against recomputation, so a constraint reading a sibling env field that
is not in cache gets an empty value: it raises spuriously or is silently
skipped (e.g. webservice OAuth2 checks seeing
auth_typeas False).Before running constraints, compute the protected env fields missing
from cache from the configuration or their stored default. The fields
being written are left alone: if evicted from cache, the ORM writes
them again before their inverse, and filling them from the defaults
would lose their new values. This is also why it is not done in the
inverse.
As env fields are now cached on create and write, the test helper
load_configinvalidates the cache when switching the configuration,otherwise dependent modules' tests read the previous values.
Same approach as OCA/server-env#293 for server_environment_data_encryption.