Skip to content
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

Fix triggering user query calls whenever a new user was added in UserListController #3184

Merged
merged 5 commits into from
May 7, 2024

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented May 7, 2024

🔗 Issue Links

Relates to https://github.com/GetStream/ios-issues-tracking/issues/800

🎯 Goal

Fixes adding new users causing additional HTTP calls just to check if the new user is part of the query.

📝 Summary

The responsible for this was NewUserQueryUpdater. This is a really old worker that we had, and it seems like we had one of these for channel lists as well, and then we had to remove it because of problems. This approach is for sure a no go, creating an HTTP call for every new user just to check if it stills matches the query is not recommended by the backend team, and it can be a pretty fragile solution. Observing this in the UserListController also seems to be an overkill. Only for the MemberListController this is useful. So for the time being, we will just remove this. If customers want UserListController to be reactive, we will need to implement the automatic query filter and/or the filter block approach that we have for channel lists.

References:

🧪 Manual Testing Notes

N/A

☑️ Contributor Checklist

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

@nuno-vieira nuno-vieira added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels May 7, 2024
@nuno-vieira nuno-vieira requested a review from a team as a code owner May 7, 2024 15:14
Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

LGTM ✅

CHANGELOG.md Outdated
@@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
# Upcoming

## StreamChat
### 🐞 Fixed
- Fix triggering user query calls whenever a new user was added in `UserListController` #[3184](https://github.com/GetStream/stream-chat-swift/pull/3184)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking if we should mention that the UserListController is no longer reactive, wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was thinking about that too, but I was afraid it might warn customers for no important reason, since most of them won't care about this, but maybe better to be transparent, so I'll add this 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Done ✅

@Stream-iOS-Bot
Copy link
Collaborator

StreamChat XCMetrics

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 6.68 ms 33.2% 🔼 🟢
Duration 2.6 s 2.55 s 1.92% 🔼 🟢
Hitch time ratio 4 ms per s 2.63 ms per s 34.25% 🔼 🟢
Frame rate 79 fps 78.16 fps 1.06% 🔼 🟢
Number of hitches 1 0.6 40.0% 🔼 🟢
ChannelList Hitches total duration 12.5 ms 14.18 ms -13.44% 🔽 🔴
Duration 2.6 s 2.21 s 15.0% 🔼 🟢
Hitch time ratio 5 ms per s 6.19 ms per s -23.8% 🔽 🔴
Frame rate 76 fps 77.89 fps -2.49% 🔽 🟡
Number of hitches 1.2 1.6 -33.33% 🔽 🔴

@nuno-vieira nuno-vieira enabled auto-merge (squash) May 7, 2024 15:35
Copy link

sonarcloud bot commented May 7, 2024

@nuno-vieira nuno-vieira merged commit 32706c0 into develop May 7, 2024
15 checks passed
@nuno-vieira nuno-vieira deleted the fix/do-not-perform-user-queries-on-new-users branch May 7, 2024 18:17
@laevandus laevandus mentioned this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants