Skip to content

One disabled or missing timer stops all later timers in a Twitch channel #723

Open

Description

@emircan-sahin

Describe the bug
When the Twitch bot starts a channel's command timers, the loop uses return instead of continue. So one disabled timer, or one whose command is missing, stops every timer after it in that channel:

for _, v := range cmdTimers {
if v.Status == 0 {
return
}
commandData, err := service.GetUserBotCommand(ctx, v.CommandName, v.BotPlatformID)
if err != nil {
log.Printf("[handler.Timer] GetUserBotCommand command_name: %v, error: %v", v.CommandName, err.Error())
return
}

To Reproduce
Give a channel timers [paused (status 0), discord, socials] and start the bot: no timers start. Expected: discord and socials start.

Related

  • DeleteBotCommand (
    func (m *postgresql) DeleteBotCommand(ctx context.Context, botPlatform platform.Platform, commandName string, botPlatformId string) (*string, *string, error) {
    ) doesn't delete the command's timer. The in-memory timer keeps posting the deleted command's content until a restart, and after the restart the orphan timer row trips the loop above.
  • UpdateTimerContent is never called, so !ucmd edits never reach a running timer.
  • !leave and the depart webhook don't stop the channel's timers (from reading the code, not tested against Twitch).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions