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

Refactor FXIOS-7596 [v121] remove legacy store #17224

Merged
merged 11 commits into from
Nov 24, 2023

Conversation

OrlaM
Copy link
Contributor

@OrlaM OrlaM commented Nov 7, 2023

📜 Tickets

Jira ticket
Github issue

💡 Description

Fully removes the legacy tab store code

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed I updated documentation / comments for complex code and public methods

@OrlaM OrlaM requested a review from lmarceau November 7, 2023 20:56
@OrlaM OrlaM requested a review from a team as a code owner November 7, 2023 20:56
@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Nov 7, 2023

Messages
📖 Project coverage: 33.79%
📖 Edited 7 files
📖 Created 0 files

Client.app: Coverage: 32.4

File Coverage
LegacyTabManager.swift 25.67% ⚠️
LegacyTabTrayViewController.swift 41.93% ⚠️
TabManagerImplementation.swift 49.39% ⚠️
UITestAppDelegate.swift 0.0% ⚠️
BrowserViewController+TabToolbarDelegate.swift 11.03% ⚠️
LegacyGridTabViewController.swift 31.4% ⚠️

Generated by 🚫 Danger Swift against cea3eb1

@isabelrios
Copy link
Contributor

isabelrios commented Nov 8, 2023

@OrlaM all the tests failed, I can't get the details because they timed out but looks like the failure is the same or similar error @skhamis had

Copy link
Contributor

@lmarceau lmarceau left a comment

Choose a reason for hiding this comment

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

UI tests failed again, but LGTM

@OrlaM
Copy link
Contributor Author

OrlaM commented Nov 9, 2023

@OrlaM all the tests failed, I can't get the details because they timed out but looks like the failure is the same or similar error @skhamis had

I fixed the crash but now any test that opens a new tab from the tab tray fails, for some reason the tests don't open a new tab. I have no idea why that is happening, it works when running the test cases manually.
This PR does free up a good bit of work on the main thread so things could be running faster where the tests may have previously relied on the delay but I tried adding some delays in spots in the tests to confirm this theory but didn't succeed.

Copy link
Contributor

mergify bot commented Nov 9, 2023

This pull request has conflicts when rebasing. Could you fix it @OrlaM? 🙏

@isabelrios
Copy link
Contributor

@OrlaM all the tests failed, I can't get the details because they timed out but looks like the failure is the same or similar error @skhamis had

I fixed the crash but now any test that opens a new tab from the tab tray fails, for some reason the tests don't open a new tab. I have no idea why that is happening, it works when running the test cases manually. This PR does free up a good bit of work on the main thread so things could be running faster where the tests may have previously relied on the delay but I tried adding some delays in spots in the tests to confirm this theory but didn't succeed.

oh, let me take a look.. if tests fail because the app runs faster, that's a good thing and easy to fix.. cc @clarmso

@isabelrios
Copy link
Contributor

@OrlaM I know where the problem is but I don't have a solution yet... the UI tests are failing when trying to open a new tab from Tab Tray, we use that action a lot(OpenNewTabFromTabTray)
Looks like as you said, tests run faster and we miss the tap in the '+' icon to open a new tab from there...
I tried to wait for that element and now the test can click on it. However, I'm seeing this weird state after clicking on '+' where it shows the keyboard as if we were in the new tab but the view has not actually changed...
Simulator Screenshot - iPhone 15 Pro - 2023-11-10 at 11 50 51

This will require further investigation .. I will keep you posted cc @clarmso

@OrlaM OrlaM force-pushed the om/FXIOS-7596-remove-legacy-store branch from e6cabee to 9603d83 Compare November 19, 2023 00:44
Copy link
Contributor

mergify bot commented Nov 21, 2023

This pull request has conflicts when rebasing. Could you fix it @OrlaM? 🙏

@OrlaM OrlaM force-pushed the om/FXIOS-7596-remove-legacy-store branch 2 times, most recently from d558fba to fba1c16 Compare November 23, 2023 19:21
@OrlaM OrlaM force-pushed the om/FXIOS-7596-remove-legacy-store branch from fba1c16 to 33d9686 Compare November 24, 2023 16:30
@OrlaM
Copy link
Contributor Author

OrlaM commented Nov 24, 2023

It's finally passing 🥳

Comment on lines +378 to +381
DispatchQueue.main.async {
self.navigationController?.dismiss(animated: true, completion: nil)
TelemetryWrapper.recordEvent(category: .action, method: .close, object: .tabTray)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not an ideal solution, but since the select tab that happens prior to this is now an async event it is causing crashes on the home page when the view is dismissed since the tab data is not fully resolved after deleting tabs. I'm comfortable putting this solution here because the legacy tab tray is going away soon anyway.

@OrlaM OrlaM changed the title Refactor FXIOS-7596 [v121] remove legacy store Refactor FXIOS-7596 [v122] remove legacy store Nov 24, 2023
@OrlaM OrlaM changed the title Refactor FXIOS-7596 [v122] remove legacy store Refactor FXIOS-7596 [v121] remove legacy store Nov 24, 2023
@OrlaM
Copy link
Contributor Author

OrlaM commented Nov 24, 2023

@Mergifyio backport release/v121

Copy link
Contributor

mergify bot commented Nov 24, 2023

backport release/v121

✅ Backports have been created

Comment on lines +78 to +79
overlayManager.openNewTab(url: nil,
newTabSettings: NewTabAccessors.getNewTabPage(profile.prefs))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm trying to understand why we need to add a call to the overlayManager in this particular PR to remove the legacy store? I guess this relates to the tests that were failing right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, for some reason it no longer triggers overlay mode at the right time. There is likely a superfluous call at the wrong time somewhere else but I was afraid to start messing with it because it's spagetified into other code paths.

@OrlaM OrlaM merged commit 21d5c81 into mozilla-mobile:main Nov 24, 2023
10 checks passed
@OrlaM OrlaM deleted the om/FXIOS-7596-remove-legacy-store branch November 24, 2023 20:21
mergify bot pushed a commit that referenced this pull request Nov 24, 2023
* Move select tab

* Update isRestoringTabs

* Remove legacy store

* Fix start up issue

* Remove store

* Clear more dead code

* Fix UI tests

* Fix tests

* Fix tests

* Fix tests

* Remove print

(cherry picked from commit 21d5c81)

# Conflicts:
#	Client.xcodeproj/project.pbxproj
OrlaM added a commit that referenced this pull request Nov 24, 2023
* Move select tab

* Update isRestoringTabs

* Remove legacy store

* Fix start up issue

* Remove store

* Clear more dead code

* Fix UI tests

* Fix tests

* Fix tests

* Fix tests

* Remove print
# Conflicts:
#	Client.xcodeproj/project.pbxproj
OrlaM added a commit that referenced this pull request Nov 24, 2023
* Move select tab

* Update isRestoringTabs

* Remove legacy store

* Fix start up issue

* Remove store

* Clear more dead code

* Fix UI tests

* Fix tests

* Fix tests

* Fix tests

* Remove print
# Conflicts:
#	Client.xcodeproj/project.pbxproj

Co-authored-by: OrlaM <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants