Repository navigation
fix(core): a host-class module taking user survives the user's acceptance - #772
Merged
Merged
Conversation
…ance A class module that fans per user at host scope was marked as a shared fan-out, for the R6 drop of a host copy when the user is accepted. The drop matches by module key, and the fanned copy carries the user's own copy's key, so both were removed: the module vanished in transition mode and under explicit user-aspects. Don't mark class-level fan-out; the two copies already dedup by key. Reported in Matrix.
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
Reported by @minhtrancccp in Matrix, with a repo that reproduces it: since #761, a host-class module in
den.defaultthat takesuseris lost from a host that accepts that user.A host accepts its users in transition mode, which is the default until a config sets
den.migrations.user-host-content.acknowledged, and under an explicitden.batteries.user-aspects. Both lose the module. Acknowledging the migration withoutuser-aspectshides it, which is why acknowledging fixed it for the reporter.Cause. #761 fans a host-scope
nixos = { user, ... }:module once per user, inhandlers/emit-classes.nix. It marked each fanned copy as a shared fan-out, for #694's R6 rule: when the host accepts the user, the user's own copy is lifted to the host, so the host's copy is dropped. The drop inedges/materialize-unified.nixmatches modules by their location key. emit-classes gives the fanned copy the same key as the user's own copy, deliberately, so the two dedup, and the drop removed both.Fix. A class module that fans per user isn't marked as a shared fan-out. Its copy and the user's own carry one key, so the module system applies them once without the drop. Aspect-level fan-out, which bind.nix marks, is unchanged. The helpers that only served the mark (
sharedWith,hostIdHash, the include-root lookup) go with it.This was missed because den's suite runs every cell with the transition defaults off (
templates/ci/modules/test-support/end-state.nix), and #761's cells never accepted a user explicitly.Validation
New cells,
templates/ci/modules/deadbugs/accepted-user-class-fan.nix. Each checks the module's per-user content lands and lands once:user-aspects, with the transition defaults off and with the migration acknowledged;The reporter's repo, evaluated against this branch:
services.kanata.enable = true,uinput.members = [ "root" "usercccp" ], as on 36c499a.Full suite (
ci.bash, 4 workers): 2214/2214.Every template's drvs are identical to main.