stream-chat-swift
stream-chat-swift copied to clipboard
[ChatStateLayer] Reset contexts when logging out
🔗 Issue Links
Related: #728
Merges to feature/chat-state-layer
🎯 Goal
Fix logout issue with duplicate channels in DB.
📝 Summary
While testing the new state in the SwiftUI SDK we found an issue:
- Log in with A
- Open channel with A and B
- Logout and log in with B
- Open channel with A and B → issue happens (assert telling multiple ChannelDTOs for the same cid)
🛠 Implementation
It seems like when we flush the database on logout, open channel is not flushed. Not sure, but I think it is related to state layer's context which immediately reacts to changes.
☑️ Contributor Checklist
- [x] I have signed the Stream CLA (required)
- [x] 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)
1 Message | |
---|---|
:book: | There seems to be app changes but CHANGELOG wasn't modified. Please include an entry if the PR includes user-facing changes. You can find it at CHANGELOG.md. |
Generated by :no_entry_sign: Danger
StreamChat XCMetrics
target |
metric |
benchmark |
branch |
performance |
status |
---|---|---|---|---|---|
MessageList | Hitches total duration | 10 ms | 15.02 ms | -50.2% 🔽 | 🔴 |
Duration | 2.6 s | 2.54 s | 2.31% 🔼 | 🟢 | |
Hitch time ratio | 4 ms per s | 5.92 ms per s | -48.0% 🔽 | 🔴 | |
Frame rate | 79 fps | 78.24 fps | 0.96% 🔼 | 🟢 | |
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 | 63.57 fps | 16.36% 🔼 | 🟢 | |
Number of hitches | 1.2 | 0.0 | 100.0% 🔼 | 🟢 |
I am going to move this PR to develop. Closing!