Skip to content

refactor(profile): make UserProfile.displayName non-nullable - #1168

Merged
bmc08gt merged 1 commit into
code/cashfrom
chore/user-profile-displayname-nonnull
Jul 28, 2026
Merged

refactor(profile): make UserProfile.displayName non-nullable#1168
bmc08gt merged 1 commit into
code/cashfrom
chore/user-profile-displayname-nonnull

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What

UserProfile.displayName was 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

  • Model: UserProfile.displayName: String?String; Empty.displayName = "".
  • Construction sites updated to satisfy the non-null contract:
    • ProfileController — fallback now uses UserProfile.Empty.copy(...).
    • ChatEntityMapper — member fallback uses UserProfile.Empty; serialized→domain coerces cached nullable name via orEmpty().
    • ProfileCoordinator — cached (nullable) name coerced via orEmpty() when mapping to domain.
  • Redundant null handling removed where the receiver is a non-null UserProfile:
    • ChatParticipantprofile.displayName.orEmpty()profile.displayName.
    • ChatViewModel / FeedSyncDelegate!displayName.isNullOrBlank()displayName.isNotBlank().
    • ContactListBuilder, UserProfileScreenContent, UserProfileViewModel, TipFlowViewModel — dropped ?/elvis at non-null sites.
  • Tests updated for the non-null field; removed a now-impossible "null display name" screen test that duplicated the existing "empty" case.

Sites where displayName is reached through a nullable profile/member were intentionally left as-is — their nullability comes from the receiver, not the field.

Testing

  • compileDebugKotlin green across all affected modules.
  • myaccount debug unit-test sources compile.

@github-actions github-actions Bot added area: network gRPC, connectivity, API, exchange rates type: refactor Code restructuring, no behavior change labels Jul 28, 2026
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
bmc08gt force-pushed the chore/user-profile-displayname-nonnull branch from 3abe0c3 to b9f7fe5 Compare July 28, 2026 02:58
@bmc08gt
bmc08gt merged commit 64cbddd into code/cash Jul 28, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the chore/user-profile-displayname-nonnull branch July 28, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant