diff --git a/app/lib/features/geckoview/domain/repositories/tab.dart b/app/lib/features/geckoview/domain/repositories/tab.dart index 3c47dbec..6c04fae1 100644 --- a/app/lib/features/geckoview/domain/repositories/tab.dart +++ b/app/lib/features/geckoview/domain/repositories/tab.dart @@ -46,11 +46,6 @@ class TabRepository extends _$TabRepository { final _tabFromIntent = {}; - /// Tracks tabs currently being processed for container assignment to prevent - /// concurrent processing of the same tab (race condition protection) - /// See: https://github.com/FaFre/WebLibre/issues/139 - final _tabsBeingProcessedForAssignment = {}; - bool hasLaunchedFromIntent(String? tabId) { if (tabId == null) { return false; @@ -447,16 +442,6 @@ class TabRepository extends _$TabRepository { final containerSiteAssignementSub = eventSerivce.siteAssignementEvent.listen( (event) async { if (event.tabId != null) { - // Prevent concurrent processing of the same tab (race condition protection) - if (_tabsBeingProcessedForAssignment.contains(event.tabId)) { - logger.d( - 'Skipping container assignment for tab ${event.tabId} - already being processed', - ); - return; - } - - _tabsBeingProcessedForAssignment.add(event.tabId!); - // ignore: only_use_keep_alive_inside_keep_alive final tabState = ref.read(tabStateProvider(event.tabId)); if (tabState != null) { @@ -497,7 +482,7 @@ class TabRepository extends _$TabRepository { selectTab: true, ); - if (tabIsEmpty) { + if (tabState.historyState.items.isEmpty) { await closeTab(tabState.id); } } else { diff --git a/app/lib/features/geckoview/domain/repositories/tab.g.dart b/app/lib/features/geckoview/domain/repositories/tab.g.dart index 138fa88d..f4bfc82d 100644 --- a/app/lib/features/geckoview/domain/repositories/tab.g.dart +++ b/app/lib/features/geckoview/domain/repositories/tab.g.dart @@ -41,7 +41,7 @@ final class TabRepositoryProvider } } -String _$tabRepositoryHash() => r'ff8ce73a65d408587cfb41e1920332d15ddff55f'; +String _$tabRepositoryHash() => r'6f3ddaa1929de2a6f8fed0e818802ab69baee220'; abstract class _$TabRepository extends $Notifier { void build();