From bf59b8272efcf0a2e3bd6248678b64cd36ab4c01 Mon Sep 17 00:00:00 2001 From: lougeniac64 Date: Mon, 28 Apr 2025 16:50:35 +0000 Subject: [PATCH] Bug 1915430 - Removed obsolete context check in shouldAllowFxaStatus function r=markh,skhamis Differential Revision: https://phabricator.services.mozilla.com/D245962 --- .../fxaccounts/FxAccountsWebChannel.sys.mjs | 5 +--- .../tests/xpcshell/test_web_channel.js | 24 ------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/services/fxaccounts/FxAccountsWebChannel.sys.mjs b/services/fxaccounts/FxAccountsWebChannel.sys.mjs index a2242d3b5bfd..edc1c8be0655 100644 --- a/services/fxaccounts/FxAccountsWebChannel.sys.mjs +++ b/services/fxaccounts/FxAccountsWebChannel.sys.mjs @@ -796,11 +796,8 @@ FxAccountsWebChannelHelpers.prototype = { // with FxA as part of a Sync flow should work all the time. If // Sync is broken in PB mode, users will think Firefox is broken. // See https://bugzilla.mozilla.org/show_bug.cgi?id=1323853 - // - // XXX - This hard-coded context seems bad? let pb = this.isPrivateBrowsingMode(sendingContext); - let ok = - !pb || service === "sync" || context === "fx_desktop_v3" || isPairing; + let ok = !pb || service === "sync" || isPairing; log.debug( `fxa status ok=${ok} - private=${pb}, service=${service}, context=${context}, pairing=${isPairing}` ); diff --git a/services/fxaccounts/tests/xpcshell/test_web_channel.js b/services/fxaccounts/tests/xpcshell/test_web_channel.js index 5237dcd2c891..cc5b5876bb8b 100644 --- a/services/fxaccounts/tests/xpcshell/test_web_channel.js +++ b/services/fxaccounts/tests/xpcshell/test_web_channel.js @@ -1404,30 +1404,6 @@ add_task( } ); -add_task( - async function test_helpers_shouldAllowFxaStatus_desktop_context_private_browsing() { - let wasCalled = { - isPrivateBrowsingMode: false, - }; - let helpers = new FxAccountsWebChannelHelpers({}); - - helpers.isPrivateBrowsingMode = sendingContext => { - wasCalled.isPrivateBrowsingMode = true; - Assert.equal(sendingContext, mockSendingContext); - return true; - }; - - let shouldAllowFxaStatus = helpers.shouldAllowFxaStatus( - "", - mockSendingContext, - false, - "fx_desktop_v3" - ); - Assert.ok(shouldAllowFxaStatus); - Assert.ok(wasCalled.isPrivateBrowsingMode); - } -); - add_task( async function test_helpers_shouldAllowFxaStatus_oauth_service_private_browsing() { let wasCalled = {