WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@EmCousin
Copy link
Contributor

@EmCousin EmCousin commented Dec 5, 2025

This PR fixes https://github.com/antiwork/gumroad-private/issues/5


Problem

Discord access lived on the giftee purchase, but DeactivateIntegrationsWorker only ran the integration tear-down on the gifter purchase whose charge failed. When the gifter’s renewal declined, the worker never touched the giftee purchase, so the Discord membership stayed active. This change makes the worker gather every purchase tied to the subscription (including giftees) before calling the Circle/Discord deactivation services, ensuring Discord roles are removed as soon as the parent subscription exits good standing.

Solution

Added logic to DeactivateIntegrationsWorker so it walks every purchase on a subscription (not just the failing one) when disabling integrations. This ensures we also hit gift receiver purchases (the ones that actually hold the Discord membership)so Discord/Circle access is revoked when the gifter’s renewal fails. Updated the Sidekiq spec to cover the gifted subscription scenario and proved both Circle and Discord services receive deactivate for the gifter and giftee purchases.

AI Disclosure

AI was used to double check the investigation's findings and provide the appropriate fix, as well as generating comprehensive specs to prevent regressions from happening. Code was reviewed manually.

@EmCousin EmCousin self-assigned this Dec 5, 2025
@EmCousin EmCousin marked this pull request as ready for review December 8, 2025 09:37
@EmCousin EmCousin requested a review from ershad December 8, 2025 09:37
@EmCousin
Copy link
Contributor Author

EmCousin commented Dec 8, 2025

@ershad _a may I ask you to review this one?

@neetogit-bot neetogit-bot bot assigned ershad and unassigned EmCousin Dec 8, 2025
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.

3 participants