Repository navigation
fix(portal): portal tasks use the shim bot id; move orphaned default schedules - #162
Merged
Merged
Conversation
…schedules (#154) In multi-bot configs without a [[bots]] id 'default', portal-created tasks were stamped bot_id='default', had no owning Telegram bot and never sent. - Portal task create/list/runs/upcoming/ownership use Config::shim_bot's id (main, then default, else first). Single-bot behaviour is unchanged. - On boot, when no bot is named 'default', move bot_id='default' rows to the shim bot and log how many moved, so old tasks keep sending. - Regression tests for single-bot, multi-bot with default, multi-bot without.
Owner
Author
|
TL ACCEPT at Matches locked AC: portal uses Merge after Product GO + QA GO (three-config matrix) + CI ( |
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.
Closes #154
Problem
Portal-created tasks were stamped
bot_id = "default". In a multi-bot config with no[[bots]]iddefault,owning_botfinds no Telegram bot for that id, so the task never sends.Fix
Config::shim_bot:main, thendefault, else the first bot). Task create, list, runs, upcoming count, and edit/delete/enable/disable ownership all usePortalState::bot_id(). Single-bot configs (iddefault) behave exactly as before.default, rows withbot_id = 'default'move to the shim bot (reminders::adopt_default_schedules), and a warning logs how many moved. When adefaultbot exists, nothing moves. Old tasks keep sending instead of silently vanishing.Out of scope
Portal web chat is unchanged. A schedule created from web chat gets
chat_id = "web", which is not a Telegram chat, so changing its bot id alone would not make it deliver. That is a separate issue.Tests
task_create_uses_shim_bot_id(portal API): single-botdefault, multi-bot withdefault+main, multi-bot withoutdefault. Each asserts the storedbot_id, that the task is listed, and that the portal can still disable it.adopt_default_schedules_only_without_a_default_bot(unit): no move with adefaultbot (single and multi), a move to the shim bot without one, other bots' rows untouched, and idempotent on re-run.cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked: 923 tests pass.QA config matrix
default: create a portal task, and it sends from that bot.defaultandmain: a portal task sends frommain; existingdefaultrows stay on thedefaultbot.default: on boot, olddefaultrows move to the shim bot (see the warning log with the count); new portal tasks send from the shim bot.