stream-chat-swift
stream-chat-swift copied to clipboard
Add user privacy settings to control user events
π 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
toChatClient.connectUser()
- Adds
UserPrivacySettings
toCurrentUserController.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)
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
@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 π
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 π
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% πΌ | π’ |
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% πΌ | π’ |
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~
Quality Gate passed
Issues
64 New issues
0 Accepted issues
Measures
0 Security Hotspots
83.4% Coverage on New Code
0.0% Duplication on New Code