[PP-1] Subscription can be enqueued for activation multiple times

Created on 7 August 2024, 8 months ago
Updated 29 August 2024, 7 months ago

Problem/Motivation

Similarly to what has been reported in 🐛 multiple recurring orders get created if cron is badly configured Needs work we may also be experiencing a similar issue with subscription activation in case processing advancedqueue runs less often than commerce_recurring_cron(). In such a case, we can end up in a situation where a single subscription is scheduled for activation several times, giving failures upon successful activation due to an invalid status check.

While this is a minor issue that is mostly about visual feedback and performance, the improvement is easy to achieve.

Steps to reproduce

Create a Subscription with the start date defaulting to now. Use drush ev "commerce_recurring_cron();" to run the module's cron multiple times. Then process advancedqueue with drush advancedqueue:queue:process commerce_recurring then go to /admin/config/system/queues/jobs/commerce_recurring

Proposed resolution

Declare the activation job as unique.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇴Norway zaporylie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024