feat(participation): participateInHackathon use case and /hackathon join (hackathon-participation 1b/3) - #44
Merged
Merged
Conversation
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
PR 1b of 3 for change 4,
hackathon-participation. It adds theparticipateInHackathonuse case and/hackathon join <slug>. With it, an admin can now confirm participation and the bot creates the🏆 <name>topic, posts the analysis there and pins it. The inline button comes in PR 2.PR 1a review fixes:
savepreservesgeneralMessageIdand copies the row, like the D1 upserts do.generalMessageId.ChatPublisher.postcomment is back in place.<=.src/domain/hackathon/topic.ts:topicNameFor/sanitizeTopicName:🏆 <name>, falling back to the slug. Control and format characters are stripped. The name is capped at 128 characters without splitting surrogate pairs.topicLink:https://t.me/c/<id>/<thread>.src/domain/hackathon/argument.ts:parseJoinArgument. A barejoingets the join usage line.src/domain/usecases/participate-in-hackathon.ts: the steps run in this order:After the topic is created, it never rethrows. A redelivery inside the 60 s claim is a no-op. A deleted topic is recreated.
src/adapters/telegram/participation.tsandhackathon-commands.ts:runParticipationand the join handler. The General reply is posted safely, so a failure there cannot trigger a webhook 500.src/composition.ts: wiresForumTopicManager.Copy: all Spanish, from the catalogs.
Review
A bounded review ran at medium risk with the reliability lens, including the security checks, over all 23 changed paths. It found no severe findings. It confirmed:
Deferred warning (R3-001): no test covers a
create()failure that is not aForumTopicCreateError. That path is unreachable with the real adapter, which wraps every failure. A test will be added first in PR 2.Tests
Operator note
The bot needs the admin right "Manage Topics" for
/hackathon jointo create topics. Without it, the bot replies in Spanish with the instruction and persists nothing.🤖 Generated with Claude Code