Skip to content

Implement: vpc-bot-comp-corner-pin-fix.md - #9

Merged
emb417 merged 1 commit into
mainfrom
vault-spec/vpc-bot-comp-corner-pin-fix
Sep 21, 2026
Merged

emb417 merged 1 commit into
mainfrom
vault-spec/vpc-bot-comp-corner-pin-fix

Conversation

@emb417

@emb417 emb417 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Auto-generated from vault spec notes/vpc-bot-comp-corner-pin-fix.md.

Fix Pin Weekly Embed Instead of Updating Old Pin

There are two issues that were not resolved by Dispatched PR #7:

  1. The new weekly competition announcement embed post should be pinned to the VPC channel instead of updating the old pin. The old pin should be unpinned.
  2. When the new weekly competition announcement is posted, two posts are created at the same time, but we should only see one.

In both case, the #tounament-corner announcements of new tournaments works correct, by unpinning the old post, pinning the new post and only messaging the new post once.


Expanded Spec

Problem

The create-week process currently updates an existing message for the weekly competition embed instead of posting a new one, causing stale content to persist. Additionally, the process triggers a double-post (or redundant message creation) for the announcement. The pinNewWeeklyCompetition logic (or the lack thereof in the create-week flow) does not match the successful implementation used in src/services/scheduler.js for tournament announcements, which correctly unpins old posts, pins the new one, and performs cleanup of system messages.

Acceptance Criteria

  1. Unpin/Pin Workflow: When a new weekly competition is created, the bot must identify the existing pinned competition message, unpin it, and pin the newly created announcement embed.
  2. Post Deduplication: Ensure the command flow calls the creation function exactly once so that only one announcement message is sent to the channel.
  3. Consistency: Implement the pinning/unpinning logic to mirror the robust patterns found in src/services/scheduler.js, specifically ensuring the old weekly pin is removed and system pin messages are cleaned up.

Notes for implementer

  • Reference the pinNewTournament function in src/services/scheduler.js as a template for the pinning/unpinning lifecycle.
  • Update src/lib/output/messages.js to include a helper function (e.g., pinNewWeeklyCompetition) that handles the logic of finding the current week's pin by title/embed signature, unpinning it, and pinning the new one.
  • Review src/commands/competition/create-week.js to ensure the flow doesn't accidentally trigger an "update" path inherited from previous logic that was intended to overwrite messages rather than replace them.
  • Ensure cleanup of "pinned a message" system messages is handled to avoid channel clutter.

@emb417 emb417 added the patch Patch-level semver bump label Sep 21, 2026
@emb417
emb417 merged commit cd3ddeb into main Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Patch-level semver bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant