wire-ios icon indicating copy to clipboard operation
wire-ios copied to clipboard

fix: use fetchRequest instead of in memory predicate - WPB-17064

Open netbe opened this issue 7 months ago β€’ 3 comments

BugWPB-17064 [iOS] hang on conversation list

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

  1. enable hang detection
  2. put app in background
  3. 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.

netbe avatar Apr 07 '25 07:04 netbe

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.

github-actions[bot] avatar Apr 10 '25 09:04 github-actions[bot]

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 - Details

    Expand 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 - Details

    Expand 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 - Details

    Expand 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;
    ..
    

datadog-wireapp[bot] avatar Apr 10 '25 09:04 datadog-wireapp[bot]

Looks good πŸ‘ Only concern, is it covered by any test, implicitly or explicitly?

@dmitrysimkin yes actually I forgot to update the tests

netbe avatar Apr 11 '25 14:04 netbe

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.

github-actions[bot] avatar Jun 13 '25 00:06 github-actions[bot]

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.

github-actions[bot] avatar Aug 29 '25 00:08 github-actions[bot]