From 0027e710962479eb9736d85289e5237d06a60866 Mon Sep 17 00:00:00 2001 From: Nils Lehnen <30603423+iderex@users.noreply.github.com> Date: Mon, 7 Sep 2026 07:47:36 +0200 Subject: [PATCH 1/2] Say what a server writes where the registrator said nothing does (#385) Two comments thirty-one lines apart in PluginServiceRegistrator.cs disagreed about whether a server writes a pairing record, and both were in force. The one at the record store registration said nothing on a server writes a record because nothing joins an enrolment to the state machine, named issue #350 for the join, and concluded that the read above it answers an empty list on every server. The one at the state machine registration, thirty-one lines below, said the join exists and that the administrative plane calls it. The second is the true one. Enrolment.Open applies LocalEvent.WindowOpened through the state machine, AdministrativePlaneController.OpenEnrolmentWindow calls it, and the windows read answers with the record in PairingState.Offered that produces. The controller's own remark already carries that correction and says so at the read; only the registrator was left stating the absence. The false sentence is the one a reader meets first, it is stated as what is UNCHANGED, and it names an issue that is closed as completed as the reason for the absence. Following that number arrives at work finished and invites the reading that something else filled the gap. It is also a sentence that travels: it is the claim that kept the consumer contract in issue #43 recorded as waiting on an enrolment that could not run, and re-reading the file for that issue is how the disagreement was found. The paragraph is rewritten in the form the rest of the file already uses for a sentence that stopped being true: it says what the comment used to say, then what the tree does now. What replaces it names issue #19, which is open, for the one absence that is still real - no record reaches PairingState.Active, because nothing derives a long term key pair for the ceremony to compare. Nothing but comment text changes. Both targets build with warnings as errors, 0 warnings and 0 errors, and the suite is green on net10.0 with 1238 passed, 6 skipped and 0 failures; this machine carries no .NET 9 runtime and none was installed for this, so the net9.0 target was compiled and not executed here. Nothing was measured against a running Jellyfin server. Closes #385 Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com> --- .../PluginServiceRegistrator.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs b/Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs index ea5bd2e..fe19d21 100644 --- a/Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs +++ b/Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs @@ -143,10 +143,14 @@ public void RegisterServices(IServiceCollection serviceCollection, IServerApplic // PairingStateMachine takes this and an IUserMappingStore and the second had no // implementation in this assembly. It has one now and both are registered below. // - // What is unchanged is that nothing on a server writes a record, because nothing joins an - // enrolment to the state machine, which is issue #350. So the read above answers an empty - // list on every server, which is stated at the action rather than left for a reader to - // infer. + // THIS COMMENT SAID NOTHING ON A SERVER WRITES A RECORD AND THAT THE READ ABOVE ANSWERS + // AN EMPTY LIST ON EVERY SERVER, because nothing joined an enrolment to the state + // machine. Enrolment.Open applies LocalEvent.WindowOpened through the state machine and + // the administrative plane calls it, so a window an administrator opens is a record in + // PairingState.Offered and the read answers with it. + // + // What is unchanged is that no record reaches PairingState.Active, because the ceremony + // that would take it there is issue #19 and nothing derives a long term key pair yet. serviceCollection.AddSingleton(services => new FilePairingRecordStore( RecordStorePath.FileFor(services.GetRequiredService()))); From 0271e8c27baa852f64d73bf3a11c27402e4c6551 Mon Sep 17 00:00:00 2001 From: Nils Lehnen <30603423+iderex@users.noreply.github.com> Date: Mon, 7 Sep 2026 07:50:27 +0200 Subject: [PATCH 2/2] Carry the two line numbers the comment repair moved (#385) The comment rewritten in the commit before this one is four lines longer than what it replaced, so every line below it in PluginServiceRegistrator.cs moved by four, and two of them are pasted in docs/logging.md as the reading that shows which types take a logger. `Reproduce every pasted reading` refused the head for it, naming docs/logging.md:200 and printing the two lines as removed and their successors as added. The two numbers are updated to what the command prints now, 220 to 224 and 239 to 243. The third line that block pastes is at 130, above the edit, and is unchanged. Found by the check rather than by reading, on the run of this pull request: reading-check: 89 reading(s) judged at HEAD - 85 reproduced, 0 historical, 3 pointer(s), 1 bad. A thing met while repairing it and not repaired here. docs/lifecycle.md pastes two lines of the same file as 50 and 160 and the file answers 52 and 264: git grep -n 'AddHostedService' -- Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:52: serviceCollection.AddHostedService(); Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:264: serviceCollection.AddHostedService(); Both were already wrong before this branch, by two lines and by a hundred and four, so neither is this change's doing and the check does not refuse either. That block pastes its command without the `origin/master:` prefix the refused one carries, which is the difference between the two, and what the check does with a paste in that shape is not measured here. It is left as it stands rather than corrected in a change about a comment. This commit is documentation text and changes no behaviour. Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com> --- docs/logging.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/logging.md b/docs/logging.md index 9af9694..a4d7dd6 100644 --- a/docs/logging.md +++ b/docs/logging.md @@ -236,8 +236,8 @@ writes is under the reading rather than counted here. origin/master:Jellyfin.Plugin.ServerPairing/Mapping/UserMappings.cs:38: private readonly ILogger _log; origin/master:Jellyfin.Plugin.ServerPairing/Mapping/UserMappings.cs:54: public UserMappings(IUserMappingStore mappings, PairingStateMachine pairings, ILogger log) origin/master:Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:130: services.GetRequiredService>())); - origin/master:Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:220: services.GetRequiredService>())); - origin/master:Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:239: services.GetRequiredService>())); + origin/master:Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:224: services.GetRequiredService>())); + origin/master:Jellyfin.Plugin.ServerPairing/PluginServiceRegistrator.cs:243: services.GetRequiredService>())); THIS BLOCK WENT STALE TWICE AND NO RUN ON THIS REPOSITORY SAW EITHER TIME. It pasted two types, then four, then five, and the command returns 7 that hold a logger; the registration line