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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
1D9E1FE524FEF56C006E561D /* TopSites in Resources */ = {isa = PBXBuildFile; fileRef = 3BC659481E5BA4AE006D560F /* TopSites */; };
1DA3CE5D24EEE73100422BB2 /* OpenTabsWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE5C24EEE73100422BB2 /* OpenTabsWidget.swift */; };
1DA3CE5F24EEE7C600422BB2 /* LegacyTabDataRetriever.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE5E24EEE7C600422BB2 /* LegacyTabDataRetriever.swift */; };
1DA3CE6324EEE83200422BB2 /* LegacySavedTab+ConfigureExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA3CE6224EEE83200422BB2 /* LegacySavedTab+ConfigureExtension.swift */; };
1DA3CE6724EEE86C00422BB2 /* AppInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65075641E37F7AB006961AC /* AppInfo.swift */; };
1DA710072AE7106B00677F6B /* AppDataUsageReportSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA710062AE7106B00677F6B /* AppDataUsageReportSetting.swift */; };
1DDAD13E24F0651C007623C8 /* TopSitesWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DDAD13C24F064F7007623C8 /* TopSitesWidget.swift */; };
Expand Down Expand Up @@ -498,7 +497,6 @@
60CE80C12667780D004026C7 /* CredentialListPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60CE80C02667780C004026C7 /* CredentialListPresenter.swift */; };
60D71AEC26AAF45E00355588 /* UIColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60D71AEB26AAF45E00355588 /* UIColorExtension.swift */; };
63306D3921103EAE00F25400 /* LegacySavedTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63306D3821103EAE00F25400 /* LegacySavedTab.swift */; };
63306D432110B3CD00F25400 /* LegacyTabManagerStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63306D422110B3CD00F25400 /* LegacyTabManagerStore.swift */; };
6669B5E2211418A200CA117B /* WebsiteDataSearchResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6669B5E1211418A200CA117B /* WebsiteDataSearchResultsViewController.swift */; };
66CE54A820FCF6CF00CC310B /* WebsiteDataManagementViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66CE54A720FCF6CF00CC310B /* WebsiteDataManagementViewController.swift */; };
6A3E5D8A283831D1001E706E /* DownloadQueueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3E5D89283831D0001E706E /* DownloadQueueTests.swift */; };
Expand Down Expand Up @@ -2133,7 +2131,6 @@
1DA24C60879E7D4B2073FD63 /* kab */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = kab; path = kab.lproj/Search.strings; sourceTree = "<group>"; };
1DA3CE5C24EEE73100422BB2 /* OpenTabsWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenTabsWidget.swift; sourceTree = "<group>"; };
1DA3CE5E24EEE7C600422BB2 /* LegacyTabDataRetriever.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyTabDataRetriever.swift; sourceTree = "<group>"; };
1DA3CE6224EEE83200422BB2 /* LegacySavedTab+ConfigureExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LegacySavedTab+ConfigureExtension.swift"; sourceTree = "<group>"; };
1DA64656B1F6A74800D22055 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LoginManager.strings; sourceTree = "<group>"; };
1DA710062AE7106B00677F6B /* AppDataUsageReportSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDataUsageReportSetting.swift; sourceTree = "<group>"; };
1DDAD13C24F064F7007623C8 /* TopSitesWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopSitesWidget.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4728,7 +4725,6 @@
62DF49B9976D5863CADF6EAA /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Menu.strings; sourceTree = "<group>"; };
63094229AA6EC744599B77A4 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/ClearPrivateData.strings; sourceTree = "<group>"; };
63306D3821103EAE00F25400 /* LegacySavedTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacySavedTab.swift; sourceTree = "<group>"; };
63306D422110B3CD00F25400 /* LegacyTabManagerStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyTabManagerStore.swift; sourceTree = "<group>"; };
634148899F41CAA3BCF71E8B /* or */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = or; path = or.lproj/Localizable.strings; sourceTree = "<group>"; };
63B04BE882C41584580E0E59 /* fa */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fa; path = "fa.lproj/Default Browser.strings"; sourceTree = "<group>"; };
63FE433D87018CDDFCF592E3 /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/ErrorPages.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -8314,12 +8310,10 @@
isa = PBXGroup;
children = (
63306D3821103EAE00F25400 /* LegacySavedTab.swift */,
1DA3CE6224EEE83200422BB2 /* LegacySavedTab+ConfigureExtension.swift */,
74C027441B2A348C001B1E88 /* LegacySessionData.swift */,
1DA3CE5E24EEE7C600422BB2 /* LegacyTabDataRetriever.swift */,
8A03309428C2653600286539 /* LegacyTabFileManager.swift */,
215B457E27D7FD4B00E5E800 /* LegacyTabGroupData.swift */,
63306D422110B3CD00F25400 /* LegacyTabManagerStore.swift */,
215B458127DA420400E5E800 /* LegacyTabMetadataManager.swift */,
5A64225029CB506500EEC3E5 /* LegacyTabManager.swift */,
);
Expand Down Expand Up @@ -12897,7 +12891,6 @@
C87DF9DB267247190097E707 /* UIConstants+BottomInset.swift in Sources */,
8AD08D1527E9198E00B8E907 /* TabsQuantityTelemetry.swift in Sources */,
81A8CA752AF97B2E0015BF04 /* AppStateAction.swift in Sources */,
1DA3CE6324EEE83200422BB2 /* LegacySavedTab+ConfigureExtension.swift in Sources */,
74B420C92A1D0D7A00370E53 /* OnboardingInstructionsPopupInfoModel.swift in Sources */,
E13E9AB32AAB0FB5001A0E9D /* FakespotViewController.swift in Sources */,
E15DE7C4293A7B0F00B32667 /* PhotonActionSheetTitleHeaderView.swift in Sources */,
Expand Down Expand Up @@ -13092,7 +13085,6 @@
BD1C89CA2A1E3CE7000A4201 /* PocketFooterView.swift in Sources */,
E12BD0AE28AC38480029AAF0 /* UIImage+Extension.swift in Sources */,
F886218C270CD3B8007F4562 /* DevicePasscodeRequiredViewController.swift in Sources */,
63306D432110B3CD00F25400 /* LegacyTabManagerStore.swift in Sources */,
D83822001FC7961D00303C12 /* DispatchQueueHelper.swift in Sources */,
EBC486992195F46B00CDA48D /* InternalSchemeHandler.swift in Sources */,
E18BAAFD28E4A44500098AE2 /* TopTabFader.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Client/Application/UITestAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class UITestAppDelegate: AppDelegate, FeatureFlaggable {
if arg.starts(with: LaunchArguments.LoadTabsStateArchive) {
let tabDirectory = "\(self.appRootDir())/profile.profile"
if launchArguments.contains(LaunchArguments.ClearProfile) {
fatalError("Clearing profile and loading a \(LegacyTabManagerStoreImplementation.storePath) is not a supported combination.")
fatalError("Clearing profile and loading tabs, not a supported combination.")
}

// Grab the name of file in the bundle's test-fixtures dir, and copy it to the runtime app dir.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ extension BrowserViewController: TabToolbarDelegate, PhotonActionSheetProtocol {
let isPrivate = tabManager.selectedTab?.isPrivate ?? false
tabManager.selectTab(tabManager.addTab(nil, isPrivate: isPrivate))
focusLocationTextField(forTab: tabManager.selectedTab)
overlayManager.openNewTab(url: nil,
newTabSettings: NewTabAccessors.getNewTabPage(profile.prefs))
Comment on lines +78 to +79
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.

}

func tabToolbarDidPressMenu(_ tabToolbar: TabToolbarProtocol, button: UIButton) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,10 @@ class LegacyGridTabViewController: UIViewController,
}

func dismissTabTray() {
self.navigationController?.dismiss(animated: true, completion: nil)
TelemetryWrapper.recordEvent(category: .action, method: .close, object: .tabTray)
DispatchQueue.main.async {
self.navigationController?.dismiss(animated: true, completion: nil)
TelemetryWrapper.recordEvent(category: .action, method: .close, object: .tabTray)
}
Comment on lines +378 to +381
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.

}

/// Handles close tab by clicking on close button or swipe gesture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ extension LegacyTabTrayViewController: UIAdaptivePresentationControllerDelegate,
extension LegacyTabTrayViewController {
@objc
func didTapAddTab(_ sender: UIBarButtonItem) {
notificationCenter.post(name: .TabsTrayDidClose)
viewModel.didTapAddTab(sender)
self.dismiss(animated: true, completion: nil)
}

@objc
Expand Down

This file was deleted.

Loading