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: Unable to tab to Contacts - WPB-10514 #1830

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 16, 2024

BugWPB-10514 [iOS] Difficulty with contacts screen

This PR was automatically cherry-picked based on the following PR:

Original PR description:


Issue

This PR fixes an unreleased bug that prevents showing the contacts view when the navigation is in a certain state. For example the following would occur prior to this fix 100% of the time:

  1. Quit app
  2. Launch app
  3. Tap Folders
  4. Tap Contacts
  5. Tap close on contacts
  6. Tap Contacts - Nothing happens no matter how many times the user taps Contacts.

The root cause of the issue is that currently ConversationListViewController is the delegate of the UITabBarController and we have two instances of ConversationListViewController - used for Conversations & Folders tabs - which both set themselves as the delegate of UITabBarController and respond to taps on the Contacts & Archive tabs by presenting a corresponding view controller on self - i.e whichever ConversationListViewController instance is the true delegate of UITabBarController. This can lead to some messed up state.

The above is necessary because how we are currently (maybe) misusing our UITabBarController - Two tabs (Conversations & Folders) contain ConversationListViewController instances with real content. The other two tabs (Contacts & Archive) contain empty UIViewController instances. We use these empty tabs as buttons and have the UITabBarControllerDelegate perform actions depending on which tab is selected.

To address this issue, this PR introduces TabBarChangeHandler which becomes the single delegate of the main UITabBarController instance. It tracks the currently selected real content tab (i.e Conversations or Folders) and makes sure to present content for Contacts & Archive on the correct real content tab.

The solution is not pretty but seems to work and is temporary. This work will all be discarded in our ongoing navigation overhaul #1361. I have attempted to minimize changes to avoid conflicts with #1361.

Testing

  1. Quit app
  2. Launch app
  3. Tap Folders
  4. Tap Contacts
  5. Tap close on contacts
  6. Tap Contacts - This should work
  7. Keep tapping on all tabs trying to break things.

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

@github-actions github-actions bot added cherry-pick echoes: bugs Technical or functional defects in the product labels Aug 16, 2024
@samwyndham samwyndham changed the title fix: Unable to tab to Contacts - WPB-10514 fix: Unable to tab to Contacts - WPB-10514 Aug 16, 2024
Copy link
Contributor Author

github-actions bot commented Aug 16, 2024

Test Results

    2 files    302 suites   2m 39s ⏱️
1 854 tests 1 854 ✅ 0 💤 0 ❌
1 862 runs  1 862 ✅ 0 💤 0 ❌

Results for commit 1d4a6a3.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Aug 16, 2024

Datadog Report

Branch report: fix/tapping-contacts-tab-WPB-10514-cherry-pick
Commit report: 69c4db5
Test service: wire-ios-mono

✅ 0 Failed, 1854 Passed, 0 Skipped, 13.84s Total Time
❄️ 1 New Flaky

New Flaky Tests (1)

  • test_it_refreshes_if_timeout_expired - Wire_iOS_Tests.TeamMetadataRefresherTests - Last Failure

    Expand for error
     Asynchronous wait failed: Exceeded timeout of 2 seconds, with unfulfilled expectations: "triggered second refresh".
     
     wire-ios/Wire-iOS Tests/TeamMetadataRefresherTests.swift:103
    

@samwyndham samwyndham added this pull request to the merge queue Aug 16, 2024
Merged via the queue into develop with commit fd0295d Aug 16, 2024
9 checks passed
@samwyndham samwyndham deleted the fix/tapping-contacts-tab-WPB-10514-cherry-pick branch August 16, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick echoes: bugs Technical or functional defects in the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants