fix(bot): publish wizard-created sessions (v3.9.9) #137

Closed
Toutsu wants to merge 0 commits from fix/issue-135-wizard-publish-schedule into main
Owner

Summary

Fixes #135.

After v3.9.8, /newsession successfully persisted sessions, but Telegram had no topic and no signup message. Production DB confirmed new sessions had thread_id = NULL, batch_message_id = NULL, and topic_created_by_bot = false.

Root cause: the Telegram wizard submit path called the shared DB create handler and then only edited the wizard draft message. It never published the created batch via IPlatformMessenger.CreateThreadAsync / SendScheduleAsync, and never stored the Telegram refs back into sessions.

Changes

  • Publish wizard-created sessions after successful DB creation.
  • Create a Telegram topic when the wizard was not started inside an existing topic.
  • Send the schedule/signup message into that topic/thread.
  • Store thread_id, batch_message_id, and topic_created_by_bot for the whole batch.
  • Avoid retrying the DB create after a publication failure, preventing duplicate sessions.
  • Replace the skipped happy-path wizard submit test with a Testcontainers-backed regression test.
  • Bump version to 3.9.9.

Related follow-up

  • #136 tracks the separate UX feature for online/offline format and link/address wizard steps.

Test plan

  • dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --nologo --verbosity normal --filter "FullyQualifiedName~CreateSessionHandlerSubmitSingleDraftTests"
    • RED before fix: constructor/publication path missing
    • GREEN after fix: 1 passed
  • dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --nologo --verbosity quiet
    • 605 passed, 1 skipped, 606 total
  • dotnet format --verify-no-changes --verbosity quiet
  • dotnet build --nologo --verbosity quiet

Workflow

  • CI passes (#315)
  • Code review approved
  • Deployed (#316)
  • Release published (v3.9.9)

Merged via fallback local merge because Gitea MCP merge returned HTTP 405. Merge commit: bbd58142dbc3179137ca6b7864270b97f3054d98.

## Summary Fixes #135. After `v3.9.8`, `/newsession` successfully persisted sessions, but Telegram had no topic and no signup message. Production DB confirmed new sessions had `thread_id = NULL`, `batch_message_id = NULL`, and `topic_created_by_bot = false`. Root cause: the Telegram wizard submit path called the shared DB create handler and then only edited the wizard draft message. It never published the created batch via `IPlatformMessenger.CreateThreadAsync` / `SendScheduleAsync`, and never stored the Telegram refs back into `sessions`. ## Changes - Publish wizard-created sessions after successful DB creation. - Create a Telegram topic when the wizard was not started inside an existing topic. - Send the schedule/signup message into that topic/thread. - Store `thread_id`, `batch_message_id`, and `topic_created_by_bot` for the whole batch. - Avoid retrying the DB create after a publication failure, preventing duplicate sessions. - Replace the skipped happy-path wizard submit test with a Testcontainers-backed regression test. - Bump version to `3.9.9`. ## Related follow-up - #136 tracks the separate UX feature for online/offline format and link/address wizard steps. ## Test plan - `dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --nologo --verbosity normal --filter "FullyQualifiedName~CreateSessionHandlerSubmitSingleDraftTests"` - RED before fix: constructor/publication path missing - GREEN after fix: 1 passed - `dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --nologo --verbosity quiet` - 605 passed, 1 skipped, 606 total - `dotnet format --verify-no-changes --verbosity quiet` - `dotnet build --nologo --verbosity quiet` ## Workflow - [x] CI passes (#315) - [x] Code review approved - [x] Deployed (#316) - [x] Release published (`v3.9.9`) Merged via fallback local merge because Gitea MCP merge returned HTTP 405. Merge commit: `bbd58142dbc3179137ca6b7864270b97f3054d98`.
Toutsu added 1 commit 2026-06-09 16:19:01 +03:00
fix(bot): publish wizard-created sessions
PR Checks / test-and-build (pull_request) Successful in 11m58s
956ec01583
After the shared create handler persists sessions, create a Telegram topic when needed, send the schedule/signup message, and store thread_id/batch_message_id/topic_created_by_bot for the batch. Add a Testcontainers regression test for the wizard SubmitDraftAsync happy path. Bump version to 3.9.9.
Toutsu closed this pull request 2026-06-09 16:55:05 +03:00
Some checks are pending
PR Checks / test-and-build (pull_request) Successful in 11m58s

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Toutsu/GmRelayBot#137