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

feat: Remove Request Queueing Setting #27886

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
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
12 changes: 0 additions & 12 deletions app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/hi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/id/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/ja/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/ko/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/pt/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/ru/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/tl/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/tr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/vi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/_locales/zh_CN/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,14 +1057,10 @@ export function setupController(

function getPendingApprovalCount() {
try {
let pendingApprovalCount =
const pendingApprovalCount =
controller.appStateController.waitingForUnlock.length +
controller.approvalController.getTotalApprovalCount();

if (controller.preferencesController.getUseRequestQueue()) {
pendingApprovalCount +=
controller.queuedRequestController.state.queuedRequestCount;
}
controller.approvalController.getTotalApprovalCount() +
controller.queuedRequestController.state.queuedRequestCount;
return pendingApprovalCount;
} catch (error) {
console.error('Failed to get pending approval count:', error);
Expand Down
1 change: 0 additions & 1 deletion app/scripts/constants/sentry-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ export const SENTRY_BACKGROUND_STATE = {
useNonceField: true,
usePhishDetect: true,
useTokenDetection: true,
useRequestQueue: true,
useTransactionSimulations: true,
enableMV3TimestampSave: true,
},
Expand Down
13 changes: 0 additions & 13 deletions app/scripts/controllers/preferences-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,19 +640,6 @@ describe('preferences controller', () => {
});
});

describe('useRequestQueue', () => {
it('defaults useRequestQueue to true', () => {
const { controller } = setupController({});
expect(controller.state.useRequestQueue).toStrictEqual(true);
});

it('setUseRequestQueue to false', () => {
const { controller } = setupController({});
controller.setUseRequestQueue(false);
expect(controller.state.useRequestQueue).toStrictEqual(false);
});
});

describe('addSnapAccountEnabled', () => {
it('defaults addSnapAccountEnabled to false', () => {
const { controller } = setupController({});
Expand Down
22 changes: 1 addition & 21 deletions app/scripts/controllers/preferences-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ export const getDefaultPreferencesControllerState =
useNftDetection: true,
use4ByteResolution: true,
useCurrencyRateCheck: true,
useRequestQueue: true,
openSeaEnabled: true,
useRequestQueue: true,
securityAlertsEnabled: true,
watchEthereumAccountEnabled: false,
bitcoinSupportEnabled: false,
Expand Down Expand Up @@ -607,17 +607,6 @@ export class PreferencesController extends BaseController<
});
}

/**
* Setter for the `useRequestQueue` property
*
* @param val - Whether or not the user wants to have requests queued if network change is required.
*/
setUseRequestQueue(val: boolean): void {
this.update((state) => {
state.useRequestQueue = val;
});
}

/**
* Setter for the `openSeaEnabled` property
*
Expand Down Expand Up @@ -816,15 +805,6 @@ export class PreferencesController extends BaseController<
return selectedAccount.address;
}

/**
* Getter for the `useRequestQueue` property
*
* @returns whether this option is on or off.
*/
getUseRequestQueue(): boolean {
return this.state.useRequestQueue;
}

/**
* Sets a custom label for an account
*
Expand Down
1 change: 0 additions & 1 deletion app/scripts/fixtures/with-preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const FIXTURES_PREFERENCES = {
useTokenDetection: true,
useCurrencyRateCheck: true,
useMultiAccountBalanceChecker: true,
useRequestQueue: true,
theme: 'light',
useExternalNameSources: true,
useTransactionSimulations: true,
Expand Down
1 change: 0 additions & 1 deletion app/scripts/lib/backup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ const jsonData = JSON.stringify({
theme: 'light',
customNetworkListEnabled: false,
textDirection: 'auto',
useRequestQueue: true,
},
internalAccounts: {
accounts: {
Expand Down
Loading