fix: resolve bot bugs and modernize container deployment - #56
Open
keryx-io wants to merge 2 commits into
Open
Conversation
Bug fixes: - Stoll (Matrix): isReply was always false (mentions == null on a never-null list), so responses were never sent as replies and mentions never resolved to real notifications. Now replies when mentions are present. - Stoll (Matrix): custom mention regex excluded the leading '@' of Matrix user IDs, so <@user:server> mentions never matched the cache. - Stoll (Matrix): shutdown now handles OperationCanceledException cleanly instead of logging an error and retrying during cancellation. - Wernstrom (Discord): log line contained a stray '$' before interpolation. - Wernstrom (Discord): roll command used new Random() (replaced with Random.Shared) and now accepts '/' as range separator as documented. - Wernstrom (Discord): channel cache add is now guarded against duplicate entries when two messages race on the same new channel. - SqliteMessageCache: last_insert_rowid() is now queried via a separate command instead of a multi-statement command Microsoft.Data.Sqlite does not execute reliably. Deployment modernization: - Rename Dockerfile.Wernstrom/Dockerfile.Stoll to conventional src/Wernstrom/Dockerfile and src/Stoll/Dockerfile with slim COPY of only the needed project dirs. - Replace push_wernstrom.sh / push_stoll.sh shell scripts with a GitHub Actions docker-publish workflow (GHCR, main + semver tags + manual). - Add docker-compose.yml for local deployment; update Makefile targets and .env_template accordingly.
WORKDIR /src makes relative COPY destinations resolve to /src/src/..., so dotnet publish found no project file (MSB1003) in the build stage. Absolute destination paths fix the container build.
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
Fixes 7 bugs found in a code review and modernizes the container deployment.
Bug fixes
isReply: mentions == nullchecked a list that is always initialized to[]and never null — so the condition was always false and messages with mentions were never sent with the reply relation. Mentions therefore never resolved to real Matrix notifications. Now replies when mentions are present. (Verified against RSMatrix'sSendHtmlResponseAsyncsignature.)@prefix.<@alice:example.org>extractedalice:example.org(without@), but the channel user cache keys use the full@alice:example.org— mentions never matched. Now the@is normalized.OperationCanceledExceptionduring cancellation was caught by the generic catch, logged as an error and triggered a reconnect retry instead of a clean shutdown. Now handled withcatch (OperationCanceledException) when (stoppingToken.IsCancellationRequested)and a clean stop, including the reconnect delay path.$"DiscordClientLog: ${message.Message}"contained a stray$before the interpolation hole, logging a literal$.rollcommand usednew Random()per call (nowRandom.Shared) and did not support/as a range separator although the option description documents "space or slash".3/6now works.last_insert_rowid()never executed. TheINSERT ...; SELECT last_insert_rowid();multi-statement command is not executed reliably by Microsoft.Data.Sqlite (trailing statements are ignored) — the rowid query is now a separate command.Deployment modernization
Dockerfile.Wernstrom/Dockerfile.Stollrenamed to the conventionalsrc/Wernstrom/Dockerfile/src/Stoll/Dockerfile; COPY now only pulls the project + shared library instead of the wholesrc/.push_wernstrom.sh/push_stoll.shshell scripts with a GitHub Actions workflow (.github/workflows/docker-publish.yml) that builds both images and pushes them to GHCR on push to main, semver tags (v*) and manual dispatch.docker-compose.ymlfor local deployment (works withpodman composetoo); updatedMakefiletargets and.env_templateaccordingly.Verification
dotnet build: 0 errors (1 pre-existing warning inStollService.Reactions.cs).docker-publishworkflow: end-to-end tested on the fork — both images build and push to GHCR.MSB1003) because relative COPY destinations resolve againstWORKDIR /src; fixed by using absolute destination paths and re-verified.