fix(participation): trophy as the topic icon and paced post/pin in fresh topics - #47
Merged
Merged
Conversation
…e the post and the pin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two problems in
hackathon-participationthat showed up in the production smoke test.1. The trophy should be the topic icon, not part of its name
Topics were created with the name "🏆 BNB Hack: …" and the default icon.
src/adapters/telegram/forum-topic-manager.ts):getForumTopicIconStickers()and matches theemojifield with U+FE0F stripped on both sides.icon_custom_emoji_idand a plain name.src/domain/hackathon/topic.ts):topicNameFor(name, slug, iconApplied)returns either the plain name or the prefixed fallback, both within the 128-character cap. The General confirmation uses the plain name.2. The pin in a freshly created topic was not applied
In production,
pinChatMessagefor the first post in a topic the bot had just created returned OK, but no pin and no "pinned a message" service message appeared. Pinning in a topic that already existed worked.participateInHackathonnow paces the fresh-topic path only, through an injectedsleep: create → link → wait 1500 ms (TOPIC_POST_DELAY_MS) → post → wait 1000 ms (PIN_DELAY_MS) → pin.postAnalysisAndLinkTopicaspinDelayMs.run-hackathon-jobcallers never wait.composition.tswires the realsetTimeoutsleep. The callback is answered before the waits.Review
A bounded review at medium risk ran the reliability lens over all 19 changed paths and found no severe findings.
Deferred warning R3-001: three e2e tests go through the real
setTimeoutsleep, adding about 2.5 s each against Vitest's default 5 s timeout. They could get flaky on a slow CI.Tests
🤖 Generated with Claude Code