refactor(profile): make UserProfile.displayName non-nullable - #1168
Merged
Conversation
Aligns the model with the proto (display name is always present as an empty string, never absent). Updates construction sites to use UserProfile.Empty / "" and drops now-redundant null handling at non-null receivers.
bmc08gt
force-pushed
the
chore/user-profile-displayname-nonnull
branch
from
July 28, 2026 02:58
3abe0c3 to
b9f7fe5
Compare
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.
What
UserProfile.displayNamewas declared nullable but the backing proto always provides a value (empty string when unset, never absent). This makes the field non-nullable to match, then cleans up the fallout.Changes
UserProfile.displayName: String?→String;Empty.displayName = "".ProfileController— fallback now usesUserProfile.Empty.copy(...).ChatEntityMapper— member fallback usesUserProfile.Empty; serialized→domain coerces cached nullable name viaorEmpty().ProfileCoordinator— cached (nullable) name coerced viaorEmpty()when mapping to domain.UserProfile:ChatParticipant—profile.displayName.orEmpty()→profile.displayName.ChatViewModel/FeedSyncDelegate—!displayName.isNullOrBlank()→displayName.isNotBlank().ContactListBuilder,UserProfileScreenContent,UserProfileViewModel,TipFlowViewModel— dropped?/elvis at non-null sites.Sites where
displayNameis reached through a nullableprofile/memberwere intentionally left as-is — their nullability comes from the receiver, not the field.Testing
compileDebugKotlingreen across all affected modules.myaccountdebug unit-test sources compile.