stream-chat-swift icon indicating copy to clipboard operation
stream-chat-swift copied to clipboard

Add user privacy settings to control user events

Open nuno-vieira opened this issue 10 months ago β€’ 6 comments

πŸ”— Issue Links

Resolves https://github.com/GetStream/ios-issues-tracking/issues/774

🎯 Goal

Allow the user to control whether he wants to share, read, or type events.

πŸ“ Summary

  • Adds UserPrivacySettings to ChatClient.connectUser()
  • Adds UserPrivacySettings to CurrentUserController.updateUserData()
  • Adds ChatCurrentUser.privacySettings
  • Only send typing events if ChatCurrentUser.privacySettings.typingIndicator.enabled
  • Allow to edit user privacy settings in the Demo App Configuration.
  • Allow to edit user privacy settings in the Demo App Profile View.

πŸ§ͺ Manual Testing Notes

  • Open Demo App Configuration
  • Enable/Disable typing indicators and read indicators
  • When connecting the user, the connectUser call in proxyman should include the privacy settings
  • If typing events are disabled, when sending a message, it should not send typing events (Check with another device and user)
  • if read receipts are disabled, when reading a message, it should not appear in the delivery receipts of the other user
  • Do the same when updating the user profile (Open the user profile view and update the privacy settings)

β˜‘οΈ Contributor Checklist

  • [x] I have signed the Stream CLA (required)
  • [x] This change follows zero ⚠️ policy (required)
  • [x] This change should be manually QAed
  • [x] Changelog is updated with client-facing changes
  • [x] New code is covered by unit tests
  • [ ] Comparison screenshots added for visual changes
  • [ ] Affected documentation updated (docusaurus, tutorial, CMS)

nuno-vieira avatar Apr 10 '24 17:04 nuno-vieira

2 Warnings
:warning: Big PR
:warning: The changes should be manually QAed before the Pull Request will be merged

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Apr 10 '24 17:04 github-actions[bot]

@nuno-vieira don't we also need UI components updates? E.g. don't send typing events, don't show read indicators.

Discussed internally. Answer: No πŸ‘

nuno-vieira avatar Apr 11 '24 11:04 nuno-vieira

General comment: let's rename "private settings" to "privacy settings" everywhere, to be consistent with backend and the spec?

Yes this was actually a typo on my end. I read "private" instead of "privacy" in the backend specs. Thanks for the catch πŸ‘

nuno-vieira avatar Apr 19 '24 00:04 nuno-vieira

StreamChat XCMetrics

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 11.68 ms -16.8% πŸ”½ πŸ”΄
Duration 2.6 s 2.55 s 1.92% πŸ”Ό 🟒
Hitch time ratio 4 ms per s 4.58 ms per s -14.5% πŸ”½ πŸ”΄
Frame rate 79 fps 78.28 fps 0.91% πŸ”Ό 🟒
Number of hitches 1 1.2 -20.0% πŸ”½ πŸ”΄
ChannelList Hitches total duration 12.5 ms 0.0 ms 100.0% πŸ”Ό 🟒
Duration 2.6 s 0.83 s 68.08% πŸ”Ό 🟒
Hitch time ratio 5 ms per s 0.0 ms per s 100.0% πŸ”Ό 🟒
Frame rate 76 fps 64.07 fps 15.7% πŸ”Ό 🟒
Number of hitches 1.2 0.0 100.0% πŸ”Ό 🟒

Stream-SDK-Bot avatar Apr 23 '24 17:04 Stream-SDK-Bot

StreamChat XCMetrics

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 5.01 ms 49.9% πŸ”Ό 🟒
Duration 2.6 s 2.54 s 2.31% πŸ”Ό 🟒
Hitch time ratio 4 ms per s 1.98 ms per s 50.5% πŸ”Ό 🟒
Frame rate 79 fps 77.95 fps 1.33% πŸ”Ό 🟒
Number of hitches 1 0.6 40.0% πŸ”Ό 🟒
ChannelList Hitches total duration 12.5 ms 0.0 ms 100.0% πŸ”Ό 🟒
Duration 2.6 s 0.83 s 68.08% πŸ”Ό 🟒
Hitch time ratio 5 ms per s 0.0 ms per s 100.0% πŸ”Ό 🟒
Frame rate 76 fps 64.06 fps 15.71% πŸ”Ό 🟒
Number of hitches 1.2 0.0 100.0% πŸ”Ό 🟒

Stream-SDK-Bot avatar Apr 23 '24 23:04 Stream-SDK-Bot

Seems like enabling/disabling read indicators does not work as expected:

  • βœ… Works as expected for Leia and Han
  • ~⚠️ Does not work for Luke and Chewbacca~

testableapple avatar Apr 30 '24 12:04 testableapple