Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed feedback button expiry/reset, and a number of squashed messag…
…es (#1) * Removed feedback button expiry/reset Early in development, I came under the impression that the initial interaction token for a discord interaction, meant that updates couldn't be made to the interaction, even in response to a component button click. I tried using the component interaction's token, and the original interaction token, and both failed. Turns out, I need to use the "Update" interaction type, rather than attempting to edit it, or defer it + respond. So, the feedback system's been updated to remove the Undo/Reset button, and to never set buttons as disabled. Now, the number of `UserFeedback` entries by type are counted for the associated `ChatCommand`, and the button labels are updated to reflect the number of times they've been selected. Also, except for the "Other" modal, a user clicking the same feedback button more than once has no effect. Updated `README.md` and tests to reflect this Minor bugfixes, cleanup, expanded tests Fixed an issue where `DisConcierge.requestQueue.requestCh` could panic due to sending on a closed channel, in cases where `Run()` was stopped via context and then started again in the same process. Added tests to expand coverage Removed `ChatCommand.mu` as it was basically vestigial Simplified `DisConcierge.Run` and `DisConcierge.shutdown` Updated the frontend `ChatCommand` model to reflect the newly-removed feedback columns Cleaning up config, interrupt/resume handling, shutdowns, etc Fixed an issue where a `CreateRun()` call that returned an error due to the context being cancelled, would cause a `ChatCommand` to report as failed, and not resume after a restart. Fixed an issue where a `ChatCommand` that had an associated OpenAI run wouldn't resume on restart, if the bot started again later than `max_age`, but before the discord interaction token expired, causing the interaction to show the 'thinking...' message permanently, instead of polling for the final run status. Switched the app config to only work off envvars and dotenv files, which should simplify configuration and make it more consistent when defining things in dockerfiles or compose. Simplified/tidied up the shutdown logic/ordering, and updated the HTTP servers to hard-close on shutdown timeout Bumped up the default TLS version for the HTTP servers Moved `APIConfig.Development` onto the top-level `Config` struct Removed some unused structs and moved some magic durations into variables/consts Fixed an issue where an invalid webhook server public key would cause startup to fail, even if the webhook server was disabled Improved propagation of shutdown signals, fixed some bugs, added tests Fixed an issue where a runtime update via the API would cause the bot's discord status to be updated twice Added `context.Context` to all `DBI` interface functions Added a new `ShutdownError` type that's used with `context.CancelCause` to signal to slash commands that `ctx.Err()` shouldn't cause the command to be marked as failed, for cases where the bot is interrupted. Fixed a broken tes I updated the `ChatCommand` resume query, which caused a test to fail. I updated the "resume" on init to set `expired` on any incomplete commands with an expired interaction token, except for those which would get picked up by the 'update run' process Fixed a bug with user feedback notifications Feedback notifications (to a configured channel ID) could exceed the discord message size limit, and fail to be delivered Also fixed some error shadowing Fixed a race condition with notifications as well Updated `isShutdownErr` to more reliably catch the shutdown signal Re-added some discord ack context, added more context-specific options New views, simplified config, and other things Updated the API and webhook servers so that SSL is optional, for cases where there might be termination at a load balancer. Also updated `SSLConfig` to support loading certs from both files and envvars (so `SSL_CERT` and `SSL_KEY` now accept the cert data, while `SSL_CERT_FILE` and `SSL_KEY_FILE` take file paths). I've also removed the `LISTEN_NETWORK` option, since I haven't tested running the bot with unix sockets anyway. Added `APIConfig.ExternalURL` to help build admin interface URLs to database records. Related to that, I've also updated the user feedback discord notifications to just report the user, feedback type, and links to the `ChatCommand` and `UserFeedback` UI records, instead of cramming all of the detail into the discord message. Also related to that, I've added a `UserFeedback` detail view, and updated the `UserFeedbackList` to link both to the detail view, and the `ChatCommand` view, via their IDs in the table. Reworked the 'initial setup' process, so now it's done via a new `init` CLI command (ex `disconcierge init`), which creates/migrates the DB, and prompts for user credentials. Removed the API-side pending setup hold and UI views. DB migrations no longer happen every time the bot starts, to avoid potential weirdness when multiple bots are starting up while connected to the same DB Cleanup, cleanup, cleanup Did a LOT of cleanup, moving tests around to where they make sense, re-ordering functions, types, adding docstrings, etc. Also replaced the temporary `nil` contexts with `context.TODO` Also updated the front-end to remove some deprecated 'setup' stuff Minor... things. Set default logging levels to WARN Fixed a reversed `gin.Mode` setting Re-added `pprof` which I accidentally removed Added tests, minor cleanup Added a test for the `init` CLI command Removed the healthcheck endpoint- I'll re-add it when I decide on a good way to actually detect the bot is 'healthy' (aka not partially deadlocked or something) Fixed an issue where multiple HTTP responses were sent after an initial failed login Removed some unused variables, fields * Added static file so the build works without the frontend * Fixed a broken test Not sure why it broke, something odd must have happened when I squashed * Increased a test's timeout * Added reset to CLI tests Added `viper.Reset()` to tests, because the wrong string representation was sticking around between tests
- Loading branch information