Issue Bug Resolved

#111421WebhookRepository runtime cache ignores the default restrictions flag

Josua Vogel 11/12/26, 10:54 updated 11/13/26, 14:25

Description

TYPO3\CMS\Webhooks\Repository\WebhookRepository::findAll() caches its result in cache.runtime under the fixed identifier webhooks_all. The query behind it depends on $applyDefaultRestrictions: without the flag only deleted records are excluded, with it disabled and start/end time limited records are excluded as well. The flag is not part of the cache identifier.

So whichever caller runs first in a process decides the result for every later caller:

  • Unrestricted first (e.g. code listing all webhooks), then WebhookMessageHandler (which sets setApplyDefaultRestrictions(true)): the handler receives disabled and time-limited webhooks and sends requests to them.
  • Restricted first, then an unrestricted caller: the caller misses disabled records.

The flag itself is mutable state on a shared service. WebhookMessageHandler sets it to true and never resets it, so later calls of getQueryBuilder() / findByDemand() in the same process (e.g. ManagementController) run with default restrictions as well.

In long-running processes (messenger:consume worker) the runtime cache may also keep the webhook list across messages, so webhooks created, disabled or changed after the first message are not seen until the worker restarts. This needs to be verified.

Expected

  • The result of findAll() depends only on the restriction setting of the call, not on earlier callers.
  • Whether disabled webhooks are delivered must not depend on what ran before in the same process. This matters for #111024 (targeted webhook messages), which promises delivery to active webhooks only.

Reviews 2

History 15

  1. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-13T14:25:12+00:00" > 11/13/26, 14:25 </span>

    Applied in changeset commit:2992028290c71b6fe4e9241cf360f5c89967df94.