Let the identity directory supply appearance a provider lacks - #2
Open
petergaultney wants to merge 1 commit into
Open
Let the identity directory supply appearance a provider lacks#2petergaultney wants to merge 1 commit into
petergaultney wants to merge 1 commit into
Conversation
`resolveAuthorIdentity` takes the first resolver that returns anything and discards the rest, so a provider record with a name but no picture beats a configured entry that has both. The `identities` setting then appears to do nothing for anyone the provider recognises - which, with Relay signed in to a directory of the whole team, is everyone. Who an ID belongs to and what they look like come from different places. A provider knows the first; whether it knows the second depends on the account it signed in with. Relay carries a picture only when the OAuth provider supplied one - Microsoft supplies none - and a colour only for the local user, drawn at random per session for its own presence cursors. So every comment author renders as initials in one uniform accent colour. A provider now wins on identity while the directory fills in picture, colour, and colourLight field by field. The directory never overrides something the provider does carry, and an entry that sets only one field does not blank the others.
petergaultney
marked this pull request as ready for review
August 17, 2026 21:13
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.
🍋:
The
identitiessetting has no effect for anyone an identity provider already recognises, which is normally everyone.resolveAuthorIdentitywalks its resolvers and returns the first one that answers at all, so a Relay record with a name and nothing else beats a configured entry carrying a name, a picture, and a colour. Configure a directory with avatars in it, and comments still render as initials.Who an ID belongs to and what they look like come from different places, and only the first is something a provider reliably knows. Relay's plugin API (
PublicAPI.ts) emitspictureonly when the OAuth provider supplied one — Microsoft accounts supply none — andcoloronly where the record has one, which for Relay is the per-session valueUser.tsdraws at random from an 8-colour palette for its own presence cursors.colorLightisn't in Relay'sUsershape at all, so the directory is its only possible source. MeanwhilenormalizeIdentityalready treats all three appearance fields as optional while requiring a name, so the two kinds of knowledge were already separable — nothing was reading them that way.So a provider stays authoritative about identity, and the directory fills in appearance the provider does not carry, field by field.
The directory never overrides something a provider does carry, and an entry setting only a colour does not blank out a picture it said nothing about.
Details
withConfiguredDecorationinsrc/identity/providers.tsis a pure function over two identities. It is the whole precedence rule.resolveAuthorIdentityand the synchronousresolveAuthorIdentitySnapshot— go through onedecoratedhelper, so they cannot drift.ConfiguredIdentityResolveris itself the answering resolver, which has nothing to fill in from.resolveUserSnapshotand swallows its own failures, so a broken directory entry degrades to an undecorated identity rather than losing the provider's answer.Not addressed here: canvas pin cards build their avatars in
src/canvas/pins.tsfromauthorInitialswith no image branch at all, and tint one only for the local user's own comments. So a canvas card shows initials even for an author who now has a picture. That is a rendering gap rather than an identity one, and I'm happy to send it separately if you want canvas cards to match the gutter and sidebar.