Skip to content

fix: Redis queue purge threshold compatibility - #529

Merged
shyim merged 1 commit into
mainfrom
fix/redis-queue-purge-threshold
Nov 15, 2026
Merged

shyim merged 1 commit into
mainfrom
fix/redis-queue-purge-threshold

Conversation

@shyim

@shyim shyim commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #528.

  • Pass a string zero to XTRIM on phpredis 6.0 and later, retaining integer zero for older extension versions.
  • Keep the existing exact stream trim and delayed-queue deletion behavior.
  • Add a regression test using the installed Redis extension's method signature.

The phpredis 5.3.7 parser accepts an integer threshold, whereas 6.0.0 changed it to a string. The parser is shared with RedisCluster, so blindly replacing zero with a string would break older installations.

Verification

  • Original implementation fails the new regression test with the reported threshold TypeError on PHP 8.4.24 / phpredis 6.2.0.
  • Fixed Redis adapter tests pass on PHP 8.4.24 / phpredis 6.2.0: 5 tests, 15 assertions.
  • New purge regression passes on PHP 8.2.32 / phpredis 5.3.7: 1 test, 4 assertions.
  • PHP syntax checks and git diff --check pass.

Remaining validation

  • Tests used an isolated PHPUnit 11.5.58 / Symfony Messenger 7.3.0 bootstrap rather than a full Shopware installation. The broader suite cannot run without Shopware, Doctrine and VarDumper dependencies.
  • Real Redis integration was attempted but local socket creation is blocked by the execution sandbox. Consumer-group preservation and delayed-key deletion have not been verified against a running server.
  • RedisCluster has not been runtime-tested.

No production services were accessed.

@shyim
shyim marked this pull request as ready for review November 15, 2026 00:31
@shyim
shyim merged commit c7198c6 into main Nov 15, 2026
12 of 13 checks passed
@shyim
shyim deleted the fix/redis-queue-purge-threshold branch November 15, 2026 00:31
@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

Updates Redis queue purging to match the installed extension’s threshold type.

  • Redis queue purges match the trim threshold to the phpredis version.

No actionable issues found. Tests were not run during this review.

Reviews (2) · Last reviewed commit: "fix: preserve Redis queue purge compatib..." · Reviewed by Greptile

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.

Error with xtrim in RedisQueueAdapter when purging queue (Argument #2 ($threshold) must be of type string, int given)

1 participant