Skip to content

fix: added ignore list for autothread channels on xCancel Generation#515

Open
asbedb wants to merge 1 commit intoreactiflux:mainfrom
asbedb:fix-x-threads
Open

fix: added ignore list for autothread channels on xCancel Generation#515
asbedb wants to merge 1 commit intoreactiflux:mainfrom
asbedb:fix-x-threads

Conversation

@asbedb
Copy link
Contributor

@asbedb asbedb commented Feb 28, 2026

Summary

Resolved a race condition between promotionThread and xCancelGenerator that caused duplicate or misaligned bot responses in specific channels.

Problem

When a user posts a link in a channel managed by both handlers, a race condition occurs. The xCancelGenerator would trigger on the main message simultaneously with the thread creation, leading to fragmented bot responses and formatting issues within the newly created threads.
image

Solution

Implemented a check to ensure xCancelGenerator logic is skipped in channels where promotionThread is active. This ensures the two features are mutually exclusive at the channel level, while still allowing the converter to run in standard text channels.

const THREAD_CHANNELS = [
  CHANNELS.events,
  CHANNELS.iBuiltThis,
  CHANNELS.iWroteThis,
  CHANNELS.techReadsAndNews,
  CHANNELS.twitterFeed,
];

// ... inside handleMessage
const isThreadChannel = THREAD_CHANNELS.includes(msg.channel.id);
if (!isThreadChannel) {
   // Execute xCancel logic
}

Potential Future Optimisations.

Centralized Config: Export the handler-to-channel mappings from index.ts as a shared constant. This would provide a single source of truth for channel-specific logic and prevent hardcoding ID lists across multiple generators.

@what-the-diff
Copy link

what-the-diff bot commented Feb 28, 2026

PR Summary

  • Updated Channel Formulation
    We have improved the way our program manages channels by incorporating an import feature from our constants.

  • Created Array for Thread Channels
    We've created an array, essentially a kind of list, for thread channels. These are specific communication pathways in the program that will now be more systematically catalogued.

  • Enhanced Message Handling
    The functionality behind how our program handles messages has been refined. If the message doesn't originate from a considered thread channel, it will streamline the process by suppressing unnecessary embeds (extra components or data) and sending a more direct URL. This ensures that non-thread messages get dealt in a more efficient manner.

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.

2 participants