Repository navigation
docsgpt-bot 0.2: unknown turn counts for upgraded conversations - #5
Merged
Merged
Conversation
Telegram v2 SQLite files hold conversations whose answers were never counted. Adding the turns column defaulted them to 0, so the next 👍 would be recorded against the wrong answer. Mark them unknown (-1); record_turn returns None for them until the chat moves to a new conversation, and run_turn records no position or message ref. Breaking: record_turn returns Option<u32>; Conversation::turns is Option<u32>. Both crates go to 0.2.0.
Merged
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.
Groundwork for moving the Telegram bot onto these crates.
The problem: Telegram v2 SQLite files hold conversations whose earlier answers were never counted. When 0.1 adds the
turnscolumn it defaults to 0, so after the upgrade the next 👍 would be recorded on answer 0 of a conversation that already has several answers.The change:
-1).Storage::record_turnreturnsOption<u32>andConversation::turnsisOption<u32>. Both areNoneuntil the chat moves to a new conversation (/new, or the server starts one).run_turnthen records no position and no message ref, so those answers offer no feedback rather than wrong feedback.Breaking API change, so both crates go to 0.2.0 in lockstep (
docsgptis unchanged). The Slack bot doesn't callrecord_turn; it moves to 0.2 with a one-line bump.Tests:
Noneuntil a new conversation, then counts from 0, and stays counted after reopening.run_turntest: a turn in an upgraded conversation continues it, has no position and records no message ref; after/newit counts from 0.cargo publish --dry-runall pass.After merging I'll push
v0.2.0(I'll confirm first); the Release workflow publishes through Trusted Publishing.