Skip to content

RM-255: Re-enable force-disabled panels#104

Merged
BenHall-1 merged 5 commits into
masterfrom
RM-255
Jun 21, 2026
Merged

RM-255: Re-enable force-disabled panels#104
BenHall-1 merged 5 commits into
masterfrom
RM-255

Conversation

@biast12

@biast12 biast12 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Description

  • When a free-tier server deletes a panel, ForceDisableSome is now called to re-enforce the 3-panel limit in both directions — if a slot opened up by deleting an active panel, the oldest force-disabled panel is automatically
    re-enabled to fill it
  • When a premium server loads their panels and any are still force-disabled (e.g. from a previous subscription lapse), EnableAll is triggered at list time to restore them, and the response reflects the corrected state immediately
    without a second fetch

Needs: TicketsBot-cloud/database#36

Type of Change

  • Bug fix
  • New feature
  • Breaking change

Testing

  • Free tier server with 5 panels (3 active, 2 force-disabled): delete an active panel → one force-disabled panel becomes active
  • Free tier server with 5 panels: delete a force-disabled panel → no state change
  • Free tier server at exactly 3 active panels with no force-disabled: delete a panel → no spurious enables
  • Premium server with force-disabled panels (simulated lapse): open the panels page → all panels re-enabled in the response

Checklist

  • My code follows the style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

When listing panels, detect any force-disabled panels and, if the guild now has a premium tier, re-enable them by calling Panel.EnableAll and clearing the ForceDisabled flag in-memory. This requires loading the bot context and checking the guild's premium tier via the RPC premium client. Also, after deleting a panel, re-enforce the free-tier panel limit by calling Panel.ForceDisableSome for non-premium guilds. Additionally, enable a local replace in go.mod for the database module (uncommented). Error conditions are propagated as internal server errors to the caller.
@biast12 biast12 requested a review from a team as a code owner April 15, 2026 19:00
@github-actions github-actions Bot added needs:bump_db PR references database repo changes needs:gomod_comment go.mod has uncommented local replace directives type:bug Bug Fixes labels Apr 25, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying tickets-v2-dashboard with  Cloudflare Pages  Cloudflare Pages

Latest commit: ed8facb
Status: ✅  Deploy successful!
Preview URL: https://91d4320f.tickets-v2-dashboard.pages.dev
Branch Preview URL: https://rm-255.tickets-v2-dashboard.pages.dev

View logs

@BenHall-1

Copy link
Copy Markdown
Member

@biast12 good to bump when you are

@biast12

biast12 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

bumped!

@github-actions github-actions Bot removed the needs:gomod_comment go.mod has uncommented local replace directives label Apr 26, 2026
@biast12 biast12 removed the needs:bump_db PR references database repo changes label Apr 26, 2026
BenHall-1
BenHall-1 previously approved these changes May 18, 2026
@github-actions github-actions Bot added the needs:bump_db PR references database repo changes label Jun 21, 2026
@BenHall-1 BenHall-1 merged commit 9b72a5b into master Jun 21, 2026
1 check passed
@BenHall-1 BenHall-1 deleted the RM-255 branch June 21, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:bump_db PR references database repo changes type:bug Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants