-
Notifications
You must be signed in to change notification settings - Fork 211
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
Replace shared current user observer used for reading privacy settings #3502
Merged
Conversation
This file contains 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
Constant observing can take time if the current user model has a lot of data attached to it
laevandus
added
🌐 SDK: StreamChat (LLC)
Tasks related to the StreamChat LLC SDK
⚡ Performance
An Issue or PR related to performance improvements
labels
Nov 20, 2024
SDK Size
|
SDK Performance
|
SDK Size
|
nuno-vieira
reviewed
Nov 20, 2024
Sources/StreamChat/Controllers/ChannelController/ChannelController.swift
Outdated
Show resolved
Hide resolved
nuno-vieira
reviewed
Nov 20, 2024
Sources/StreamChat/Controllers/ChannelController/ChannelController.swift
Outdated
Show resolved
Hide resolved
nuno-vieira
reviewed
Nov 20, 2024
nuno-vieira
approved these changes
Nov 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! ✅ It complicates a bit the code, but for now there's no alternative 👍
Quality Gate passedIssues Measures |
laevandus
added
🟢 QAed
A PR that was QAed
and removed
🤞 Ready For QA
A PR that is Ready for QA
labels
Nov 21, 2024
QAed with @testableapple |
# Conflicts: # CHANGELOG.md
Merged
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
⚡ Performance
An Issue or PR related to performance improvements
🟢 QAed
A PR that was QAed
🌐 SDK: StreamChat (LLC)
Tasks related to the StreamChat LLC SDK
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.
🔗 Issue Links
Part of IOS-558
🎯 Goal
Remove current user controller since it takes unnecessary CPU time when reacting to DB changes
📝 Summary
🛠 Implementation
We had a perf issue some time ago where we used to create the
ChatCurrentUserController
every single time when checking for typing state (on each key press). Then we started to use a shared instance for that. Solved the issue, but there is one downside, reacting to current user changes can get expensive (e.g. current user has many muted channels which triggers recreating channel objects when updating the immutableCurrentChatUser
type). Instead all of this, we should just read the data we need and skip controllers.🧪 Manual Testing Notes
Try typing events, if disabled, should not appear, otherwise appear.
☑️ Contributor Checklist