# Decisions One line per decision, with the reason. ## Target and build - Target Jellyfin **10.11.11** (`Jellyfin.Controller` / `Jellyfin.Model` 10.11.11, `net9.0`): it is the last 10.11 release on NuGet; the nuspec of that package lists `net9.0` as its only framework. Versions live in `Directory.Build.props`. - `targetAbi` is `10.11.0.0`: the plugin only uses APIs that exist across 10.11, so it should not be pinned to the patch release it was compiled against. - Removed the template's `.github` workflows and Renovate preset: they call reusable workflows and secrets of the Jellyfin organisation and cannot run elsewhere. Replaced by one self-contained workflow for Gitea Actions in `.gitea/workflows`; it talks to the Gitea API with `curl`, so it needs no forge-specific CLI on the runner. - Releases are driven by the version, not by hand-made tags: a push to `main` whose `build.yaml` version has no `v` tag is tagged and released by the workflow. The plugin repository manifest is a release asset carried forward from release to release, so nothing has to be committed back by CI. - Removed the template's `.vscode` folder: it assumes a local checkout of the Jellyfin server and web client next to the repo. - No analyzer warnings are suppressed project-wide. The only suppressions are three `CA2100` pragmas in `Storage/` where a command text is assigned from a constant string, which the analyzer cannot see through a helper. - The test project does not reference the StyleCop/`AllEnabledByDefault` analyzer set: XML docs and naming rules on test methods add noise without value. It still builds with warnings as errors. ## Storage - **SQLite via `Microsoft.Data.Sqlite`**, not JSON files. Jellyfin 10.11.11 ships `Microsoft.Data.Sqlite` 9.0.11 itself; the plugin references exactly that version with `ExcludeAssets="runtime;native"`, so no SQLite DLL (managed or native) ends up in the plugin folder and the host's copy is used. Verified in the 10.11.11 container: the plugin zip contains only `Jellyfin.Plugin.Herald.dll`, and the database is created and migrated on first use. - Database path is `/herald/herald.db` (`IApplicationPaths.DataPath`), not `BasePlugin.DataFolderPath`: the latter resolves to a folder inside `plugins/` whose name can include the plugin version, so data would be left behind on every update. - Writes go through one lock and one transaction each; the file runs in WAL mode so reads are not blocked. Schema changes are numbered scripts tracked in `PRAGMA user_version`. - A database newer than the plugin (downgrade) fails loudly instead of being opened. ## Notices - `Target` is an object `{ AllUsers, UserIds }`: clearer than "empty list means everyone", which would turn a notice for one deleted user into a notice for all. - Editing a notice does not show it again. Only "Re-show to everyone" bumps `Revision`: fixing a typo should not interrupt everybody. - The first response of a user to a revision is kept; later ones for the same revision are ignored. This keeps the record of what the user actually did. - `Ack` with an outdated revision returns `409`, for a missing, disabled or not-addressed notice `404`, and `Dismissed` on a must-accept notice `400`. - The acknowledgement report covers the current revision only. Older rounds stay in the database but are not exposed; nobody asked for history. - The pending-users list in the report only contains users that still exist. Responses of deleted users are kept and shown without a name. - `GET /Herald/Notices/Pending` with an API key (no user) returns an empty list rather than an error. - Body format is the Markdown subset from the task (bold, italic, links, lists) rendered in the browser with DOM nodes; the server stores the text as typed. Links are limited to `http`, `https` and `mailto`. - Notice titles and ids are logged. Bodies and user names are not. ## Client injection - Registration with File Transformation is done purely by reflection, including building the payload: the `JObject` is created by calling `Parse` on the parameter type of `RegisterTransformation`, so the plugin has no Newtonsoft reference of its own. - The file pattern is `^index\.html$`. File Transformation treats patterns as regular expressions, and the unanchored `index.html` also matched the script chunk `session-login-index-html..chunk.js`, which broke the login page. Found in the container test. - The transformer leaves anything without a `` alone, as a second line of defence against touching non-HTML files. - The script tag uses the relative URL `../Herald/client.js` so it keeps working behind a base URL. - `GET /Herald/client.js` is anonymous: a `