How QCFUM Prevents Join-Code Usage-Limit Races
A limited Join Code can receive multiple submissions at nearly the same time. QCFUM 2.0.4 protects the final available uses with a conditional database update instead of relying only on the count shown when the page was loaded.
This matters most for a code with one remaining use: two browsers can both see the code before either submits, but only one reservation can successfully claim the final slot.
The Reservation Is Atomic
Before creating the Joomla account, reserveJoinCodeUse() runs one database UPDATE that increments used_count only when the code ID still exists, is published, is not expired, and either has no limit or still has used_count < usage_limit.
Affected Rows Decide the Winner
QCFUM treats the reservation as successful only when exactly one row was updated. If another request already consumed the last allowed use, the second UPDATE affects zero rows and QCFUM returns “This Join Code is no longer available. Refresh and try again.”
The Reservation Happens Before User Creation
After the reservation succeeds, QCFUM creates the Joomla user using the current Pack/Profile workflow. Reserving first prevents two successful accounts from both consuming the same final logical use.
Failed Creation Rolls Back the Count
If Joomla/QCFUM account creation fails, releaseJoinCodeUse() decrements the counter, never below zero. That returns the reserved capacity so a corrected submission can try again.
Operational Meaning
- The number shown in the selector is useful context, not a guarantee until submission.
- Do not implement a separate manual counter around QCFUM Join Codes.
- If a user receives the no-longer-available message, refresh before deciding whether the code truly has capacity.
Community Discussion
Want to compare Joomla user-onboarding workflows, share practical QCFUM tips, or discuss how other administrators use this feature? Visit the QC Frontend User Manager Community. For private support, bug reports, account-specific entitlement problems, or feature requests, use the QuantaCade support system.