Resolves the principal a configured candidate names, falling back deterministically.
The ladder, in order:
Name — tried first so that every host resolving today resolves to the SAME user as
before. This is what makes adding the Email rung a compatible change rather
than a semantic one. ACTIVE only, which is that compatibility claim's one
deliberate exception: a host whose setting names a DEACTIVATED user stops
resolving to them. That is the point, not a casualty — see below.
Email — the identity column everywhere else in MJServer, and the only one the schema
makes unique (UQ_User_Email). This is the rung that resolves MJ's own default.
ACTIVE only, for the same reason.
System — by ID, so it survives the system user being renamed. ACTIVE only.
Owner — lowest ID among ACTIVE owners. A last resort, but still deterministic: the
previous "first Owner in cache order" made CreatedByUserID depend on the order
SELECT * FROM vwUsers happened to return, which is unstable across boots and
within a process.
Every rung breaks ties by lowest ID (lowestActiveById), never by array position, and no rung
returns an inactive user — the configured rungs included. An operator naming a user in config
is the likeliest way to end up pointed at a disabled account (the admin whose address is in the
setting leaves, and their account is deactivated), and honouring it would mean the server keeps
provisioning as someone who no longer works there, silently and indefinitely. A guarantee that
every rung holds except the two anyone actually configures is not a guarantee.
Pure, and reports rather than logs, so the caller owns log volume and phrasing.
Resolves the principal a configured candidate names, falling back deterministically.
The ladder, in order:
Name— tried first so that every host resolving today resolves to the SAME user as before. This is what makes adding theEmailrung a compatible change rather than a semantic one. ACTIVE only, which is that compatibility claim's one deliberate exception: a host whose setting names a DEACTIVATED user stops resolving to them. That is the point, not a casualty — see below.Email— the identity column everywhere else in MJServer, and the only one the schema makes unique (UQ_User_Email). This is the rung that resolves MJ's own default. ACTIVE only, for the same reason.CreatedByUserIDdepend on the orderSELECT * FROM vwUsershappened to return, which is unstable across boots and within a process.Every rung breaks ties by lowest ID (lowestActiveById), never by array position, and no rung returns an inactive user — the configured rungs included. An operator naming a user in config is the likeliest way to end up pointed at a disabled account (the admin whose address is in the setting leaves, and their account is deactivated), and honouring it would mean the server keeps provisioning as someone who no longer works there, silently and indefinitely. A guarantee that every rung holds except the two anyone actually configures is not a guarantee.
Pure, and reports rather than logs, so the caller owns log volume and phrasing.