Skip to content

fix: apply all PR #57 review fixes (Codex, CodeRabbit, codeant-ai) - #58

Merged
gamblecodezcom merged 2 commits into
mainfrom
claude/update-prod-runner-script-Lq2gS
Feb 21, 2026
Merged

fix: apply all PR #57 review fixes (Codex, CodeRabbit, codeant-ai)#58
gamblecodezcom merged 2 commits into
mainfrom
claude/update-prod-runner-script-Lq2gS

Conversation

@gamblecodezcom

@gamblecodezcom gamblecodezcom commented Feb 21, 2026

Copy link
Copy Markdown
Owner

User description

  1. escapeMarkdownV2 helper + title escaping in announceGiveaway

    • Added escapeMarkdownV2(text) to escape _ * ` [ ] in user-supplied text
    • Applied to giveaway.title in announceGiveaway() to prevent Markdown injection
  2. Enforce joinSurface on join paths

    • DM deep-link (?start=join_gw_): rejects with "can only be joined from the group chat" when joinSurface === 'group'
    • gw_join_ inline button: rejects DM users when joinSurface === 'group', rejects group users when joinSurface === 'dm'
  3. Remove duplicate admin_dashboard_action handler

    • Removed admin_dashboard_action_v2_noop placeholder stub
    • Single handler at line ~3708 is the only registration
  4. Giveaway wizard edge case fixes

    • awaitingAdminDecision flag prevents double-trigger of admin notification when timer fires before admin has clicked extend/force-end
    • gw_auto_extend clears awaitingAdminDecision before resetting timer so next fire can re-evaluate
    • pinnedMsgId set to null after unpinChatMessage in finalizeGiveaway
    • DM broadcast already respects optOutBroadcasts and muted flags (verified)
    • joinSurface enforcement covers group-only and DM-only cases end-to-end
  5. CI/CD fixes

    • ci.yml: Added BOT_TOKEN: ${{ secrets.BOT_TOKEN }} to smoke test step env so require('./index.js') does not throw when BOT_TOKEN is needed at load time
    • deploy.yml: Added BOT_TOKEN to global env block; expanded deploy job environment from shorthand to name: production form per spec

https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN


CodeAnt-AI Description

Prevent Markdown injection in announcements, enforce where users can join giveaways, and avoid duplicate admin notifications

What Changed

  • Giveaway titles and other user-supplied text are escaped so they no longer break Telegram message formatting
  • Joining a giveaway now rejects attempts from the wrong context with clear messages:
    • DM deep-link rejects if giveaway is group-only
    • Group button rejects if giveaway is DM-only (and vice versa)
  • Admin notification and timer behavior for under-subscribed giveaways fixed:
    • Prevents duplicate admin prompts when a timer fires while an admin decision is pending
    • Clears the pending flag when timers are reset and when a giveaway is finalized
  • Announcement unpinning now clears the stored pinned message reference so it won't be reused
  • CI and deploy workflows updated so the code can be loaded in smoke tests and deployment uses the correct environment shape

Impact

✅ Clearer giveaway titles (no broken formatting)
✅ Fewer wrong-context join attempts
✅ Fewer duplicate admin notifications

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • Giveaway join source enforcement: Group-only giveaways now reject DM joins, and vice versa, with clear rejection messages.
  • Bug Fixes

    • Fixed duplicate admin notification prompts during giveaway auto-extend operations.
    • Improved message formatting to prevent special character display issues.
    • Enhanced state cleanup for pinned messages after giveaway completion.
  • Chores

    • Updated CI/CD workflows for improved deployment configuration.

1. escapeMarkdownV2 helper + title escaping in announceGiveaway
   - Added escapeMarkdownV2(text) to escape _ * ` [ ] in user-supplied text
   - Applied to giveaway.title in announceGiveaway() to prevent Markdown injection

2. Enforce joinSurface on join paths
   - DM deep-link (?start=join_gw_<id>): rejects with "can only be joined from
     the group chat" when joinSurface === 'group'
   - gw_join_<id> inline button: rejects DM users when joinSurface === 'group',
     rejects group users when joinSurface === 'dm'

3. Remove duplicate admin_dashboard_action handler
   - Removed admin_dashboard_action_v2_noop placeholder stub
   - Single handler at line ~3708 is the only registration

4. Giveaway wizard edge case fixes
   - awaitingAdminDecision flag prevents double-trigger of admin notification
     when timer fires before admin has clicked extend/force-end
   - gw_auto_extend clears awaitingAdminDecision before resetting timer so next
     fire can re-evaluate
   - pinnedMsgId set to null after unpinChatMessage in finalizeGiveaway
   - DM broadcast already respects optOutBroadcasts and muted flags (verified)
   - joinSurface enforcement covers group-only and DM-only cases end-to-end

5. CI/CD fixes
   - ci.yml: Added BOT_TOKEN: ${{ secrets.BOT_TOKEN }} to smoke test step env so
     require('./index.js') does not throw when BOT_TOKEN is needed at load time
   - deploy.yml: Added BOT_TOKEN to global env block; expanded deploy job
     environment from shorthand to name: production form per spec

https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN
@codeant-ai

codeant-ai Bot commented Feb 21, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Feb 21, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Environment variables for BOT_TOKEN are added to CI/CD workflows. The main application introduces Markdown v2 escaping for titles, enforces group/DM join restrictions on giveaways, and adds state guards to prevent duplicate admin prompts during giveaway operations and cleanup logic during finalization.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/ci.yml, .github/workflows/deploy.yml
Added BOT_TOKEN environment variable to CI and deployment workflows; updated deploy workflow environment mapping structure.
Giveaway Join Logic & State Management
index.js
Introduced escapeMarkdownV2 utility for safe Markdown v2 character escaping in titles. Enforced group/DM join source restrictions with explicit rejection messages. Added awaitingAdminDecision guard flag to prevent duplicate admin prompts during auto-extend logic. Enhanced finalization cleanup to reset state flags and unpin messages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Token secrets safely bound,
Markdown escapes now safe and sound,
Giveaways know where they belong—
Groups stay grouped, no more wrong,
Guards prevent admin calls twice,
State cleanup keeps things nice! 🎉


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@gamblecodezcom
gamblecodezcom merged commit 16723d5 into main Feb 21, 2026
2 checks passed
@gamblecodezcom
gamblecodezcom deleted the claude/update-prod-runner-script-Lq2gS branch February 21, 2026 16:45
@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Feb 21, 2026
@codeant-ai

codeant-ai Bot commented Feb 21, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

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

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants