Discord Purchase Roles changelog¶
1.1.0¶
Added¶
- Multiple server overrides and multiple role mappings per product.
- Sync after OAuth linking, product/owner transfers, mapping/configuration edits, plus a 15-minute reconciler and bounded queue retries with backoff.
- Durable grant ownership and pending-operation ledger; untracked manual roles remain protected. Explicit, confirmed legacy-role adoption is available.
- Safe account switching, persistent pending unlink and cleanup after customer deletion, with shared customer/Discord identity locks.
- Optional OAuth server joining with consent, token refresh and screening checks.
- Account navigation, reconnect, admin unlink, queue-all and grant/cleanup UI.
Changed¶
- Unlink now removes all tracked grants, including disabled mappings, rather than guessing ownership from current enabled mappings. Upgrade does not automatically adopt existing roles; administrators can explicitly adopt verified legacy roles.
- Explicit Unknown Member responses allow safe cleanup of departed members; other API failures retain operation intent. Sensitive response logging removed.
1.0.1¶
Fixed¶
- Unlink now removes roles covered by enabled mappings before deleting the account link, even for active services or mappings with remove-on-inactive disabled. Unmapped roles and disabled mappings remain untouched.
- Failed role removal or unreadable Discord member state retains the link and displays an error, allowing safe retries after partial removal.
- Unlink and role sync lock the same account row to prevent concurrent queued syncs from granting roles during unlink.
- Partial role sync failures now propagate to customer and admin notifications.
1.0.0¶
Initial release.
Added¶
- Discord bot configuration stored in the extension's own settings record: bot
token, OAuth2 client ID and secret, server (guild) ID and suspension behaviour.
Secrets use Laravel's
encryptedcast and are hidden from serialisation. - Test connection action that verifies the bot token and reads the configured guild through Discord's API, storing the outcome for troubleshooting.
- Customer account linking through Discord OAuth2 with the
identifyscope only, a per-attemptstatevalue stored in the customer's session and validated withhash_equals()on the callback. - Protection against account takeover: a Discord account that is already linked to another customer is refused, and links are always written for the authenticated customer.
- Customer page under Account → Discord with link, unlink and self-service role sync.
- Product to Discord role mapping with an
enabledtoggle and aremove_on_inactiveswitch, both validated as Discord snowflakes. - Automatic role grants when a customer owns a qualifying service, and automatic role removal for the mappings that ask for it.
- Configurable suspension behaviour, defaulting to keeping the role while a service is suspended.
- Removal is limited to roles covered by a mapping with
remove_on_inactive; roles granted by hand are never touched. - Unknown member state (not in the guild, or a Discord failure) never strips roles.
- Role syncs are queued jobs triggered by Eloquent service events (created, status changed, deleted), so no Discord call happens inside a customer request.
- Manual Sync Discord Roles action per linked customer in the admin area.
- Every Discord failure is caught, logged and stored on the account; a Discord outage can never break Paymenter.
- Admin resources: Discord Settings, Discord Role Mappings and Discord Accounts.
- Automatic migration of the extension's tables on install/enable/update and rollback on uninstall.
- Automated test suite with a mocked Discord API covering encryption of secrets, serialisation hiding, snowflake validation, eligibility rules (active, suspended, pending, cancelled, disabled mappings), grant, removal, remove-on-inactive off, unknown member state, API errors, unlinked and unconfigured states, queued syncs on service lifecycle events, the customer page, OAuth state validation, successful linking, takeover attempts, denied consent and unlinking.