wire-ios
wire-ios copied to clipboard
fix: use fetchRequest instead of in memory predicate - WPB-17064
|
|
Issue
When resuming the app, the conversation lists are recreated and conversations filtered and sort again. This is done in memory and causes a hang when applying the filtering (touching conversationType).
Use fetchRequests for all filters instead.
Note: Eventually, we could replace ConversationList and ConversationListSnapshot with just a fetchrequestController that would be applied a predicate each time.
Testing
- enable hang detection
- put app in background
- put app in foreground Observe no hang is produced
Checklist
- [ ] Title contains a reference JIRA issue number like
[WPB-XXX]. - [ ] Description is filled and free of optional paragraphs.
- [ ] Adds/updates automated tests.
UI accessibility checklist
If your PR includes UI changes, please utilize this checklist:
- [ ] Make sure you use the API for UI elements that support large fonts.
- [ ] All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
- [ ] New UI elements have Accessibility strings for VoiceOver.
Test Results
2β425 testsβββ2β420 β ββ4m 18s β±οΈ ββ259 suitesββββββ0 π€ ββββ1 filesββββββββ5 β
For more details on these failures, see this check.
Results for commit c657f4de.
:recycle: This comment has been updated with latest results.
Datadog Report
Branch report: fix/perf-conversationList
Commit report: 2d500c6
Test service: wire-ios-mono
:x: 5 Failed (0 Known Flaky), 2420 Passed, 0 Skipped, 4m 17.91s Total Time
:x: Failed Tests (5)
-
testThatItReturnsAllConversations-WireDataModelTests.ZMConversationListDirectoryTests -
testThatItReturnsUnarchivedConversations-WireDataModelTests.ZMConversationListDirectoryTests -
testThatItsReturnsOneToOneConversations-WireDataModelTests.ZMConversationListDirectoryTests- DetailsExpand for error
MConversationListDirectoryTests.m:329: (([NSSet setWithArray:list.items]) equal to (expected)) failed: ("{( <ZMConversation: 0x60000296c700> (entity: Conversation; id: 0x600000669e00 <x-coredata://ACF5D5DD-E3C8-49DB-80B8-70C0496E3D1C/Conversation/p43>; data: { accessModeStrings = nil; accessRoleString = nil; accessRoleStringsV2 = nil; allMessages = ( ); archivedChangedTimestamp = nil; cellName = nil; ciphersuite = 0; .. -
testThatItDoesNotReturnNonOneOnOneConversations()-WireDataModelTests.ZMConversationListTests_OneOnOne- DetailsExpand for error
MConversationListTests+OneOnOne.swift:100: XCTAssertEqual failed: ("[<ZMConversation: 0x6000029a57a0> (entity: Conversation; id: 0x60000064eca0 x-coredata://673C2273-DAA6-40F4-94B4-020DF1EACD4D/Conversation/p17; data: { accessModeStrings = nil; accessRoleString = nil; accessRoleStringsV2 = nil; allMessages = "count: 0 {}"; archivedChangedTimestamp = nil; cellName = nil; ciphersuite = 0; clearedTimeStamp = nil; commitPendingProposalDate = nil; .. -
testThatItReturnsAllOneOnOneConversations()-WireDataModelTests.ZMConversationListTests_OneOnOne- DetailsExpand for error
MConversationListTests+OneOnOne.swift:68: XCTAssertEqual failed: ("[<ZMConversation: 0x60000296d960> (entity: Conversation; id: 0x600000607780 x-coredata://10CB23B3-7B75-4132-A6F2-091BFA62D008/Conversation/p26; data: { accessModeStrings = nil; accessRoleString = nil; accessRoleStringsV2 = nil; allMessages = "count: 0 {}"; archivedChangedTimestamp = nil; cellName = nil; ciphersuite = 0; clearedTimeStamp = nil; commitPendingProposalDate = nil; ..
Looks good π Only concern, is it covered by any test, implicitly or explicitly?
@dmitrysimkin yes actually I forgot to update the tests
This PR is stale because it has been open 30 days with no activity. Please update it or close it in case is not relevant anymore.
This PR is stale because it has been open 30 days with no activity. Please update it or close it in case is not relevant anymore.