Skip to content

Fix unsetProperties not having any effect in CurrentUserController.updateUserData() #3650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Apr 16, 2025

🔗 Issue Links

https://linear.app/stream/issue/IOS-803/unsetproperties-does-not-do-anything-in-current-user-controller

🎯 Goal

Fix unsetProperties not having any effect in CurrentUserController.updateUserData().

📝 Summary

  • Fixes unsetProperties not doing anything inCurrentUserController.updateUserData().
  • Makes sure the current user updater does not have default values.
  • Changes teamsRole parameter to use existing types.

🧪 Manual Testing Notes

  1. Log in with a user who has an image set
  2. Open a channel and its debug menu: Reset User Image
    Result: User's image is reset in the channel list (image in the top left corner)

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@nuno-vieira nuno-vieira requested a review from a team as a code owner April 16, 2025 17:48
@Stream-SDK-Bot
Copy link
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 3.34 ms 66.6% 🔼 🟢
Duration 2.6 s 2.54 s 2.31% 🔼 🟢
Hitch time ratio 4 ms per s 1.31 ms per s 67.25% 🔼 🟢
Frame rate 75 fps 78.57 fps 4.76% 🔼 🟢
Number of hitches 1 0.4 60.0% 🔼 🟢

/// - completion: Called when user is successfuly updated, or with error.
func updateUserData(
name: String? = nil,
imageURL: URL? = nil,
privacySettings: UserPrivacySettings? = nil,
role: UserRole? = nil,
teamsRole: [String: String]? = nil,
teamsRole: [TeamId: UserRole]? = nil,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamId is not a breaking change. But UserRole it is kinda a breaking change. IMO it is not a big deal, but let me know WDYT. Overall it would be nice we keep the consistency of the types here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine - we don't advertise this feature for now anyway.

@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Apr 16, 2025

SDK Size

title develop branch diff status
StreamChat 7.41 MB 7.41 MB 0 KB 🟢
StreamChatUI 4.78 MB 4.78 MB 0 KB 🟢

Copy link

/// - completion: Called when user is successfuly updated, or with error.
func updateUserData(
name: String? = nil,
imageURL: URL? = nil,
privacySettings: UserPrivacySettings? = nil,
role: UserRole? = nil,
teamsRole: [String: String]? = nil,
teamsRole: [TeamId: UserRole]? = nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine - we don't advertise this feature for now anyway.

@nuno-vieira nuno-vieira merged commit 4cce90f into develop Apr 17, 2025
14 checks passed
@nuno-vieira nuno-vieira deleted the fix/unset-properties-not-used-in-current-user-controller branch April 17, 2025 10:42
@Stream-SDK-Bot Stream-SDK-Bot mentioned this pull request Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants