Repository navigation
fix(workflowengine): only use the cached event list when it is an array - #67685
Open
kukanggg89 wants to merge 1 commit into
Open
kukanggg89 wants to merge 1 commit into
kukanggg89 wants to merge 1 commit into
Conversation
getAllConfiguredEvents() returned whatever the distributed cache held for 'events' as long as it was not null. A broken cache entry (false from APCu, as in nextcloud#54473) then threw a TypeError from the array return type while the app boots, failing every request until the cache was cleared. Only trust the cached value when it is an array; anything else falls back to the database query and re-populates the cache. Fixes nextcloud#67482 Signed-off-by: parel <farelalfarizi89@gmail.com> Assisted-by: Muse:Muse Spark 1.3
kukanggg89
requested review from
leftybournes and
provokateurin
and removed request for
a team
December 4, 2026 07:34
This branch has not been deployed
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.
Summary
Manager::getAllConfiguredEvents()returned whatever the distributed cache held foreventsas long as it was notnull. A broken cache entry,falsefrom APCu as in #54473, then threw aTypeErrorfrom thearrayreturn type while the app boots, so every request failed until the cache was cleared.The method now only trusts the cached value when
is_array($cached)is true. Anything else falls through to the database query, which re-populates the cache with the fresh list.apps/workflowengine/tests/ManagerTest.phpgets a new test,testGetAllConfiguredEventsIgnoresNonArrayCache: with the cache returningfalse, the method returns the one configured operation from the database instead of failing, and writes the rebuilt list back to the cache.Verification: the new test was not run locally, there is no PHP on the machine this change was made on, so CI has to run it. The change is one condition, and the test follows the existing
testGetAllConfiguredEventssetup in the same file.TODO
No open TODOs.
Checklist
3. to review, feature component) (n/a: maintainers set labels)stable32) (n/a: maintainers set the milestone)AI (if applicable)
Drafted with help from Claude. I reviewed and revised every change myself before opening this PR.