Skip to content

A local-first personal finance app

Rename loot-core/platform/client/fetch to connection to match server-side package (#6943)

Joel Jeremy Marquezcb5237359ce7
diff --git a/packages/desktop-client/src/accounts/accountsSlice.ts b/packages/desktop-client/src/accounts/accountsSlice.ts
index fa1c184782..607a0e1817 100644
--- a/packages/desktop-client/src/accounts/accountsSlice.ts
+++ b/packages/desktop-client/src/accounts/accountsSlice.ts
@@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
import memoizeOne from 'memoize-one';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { SyncResponseWithErrors } from 'loot-core/server/accounts/app';
import { groupById } from 'loot-core/shared/util';
import type {
diff --git a/packages/desktop-client/src/app/appSlice.ts b/packages/desktop-client/src/app/appSlice.ts
index febb78bdc8..96c9f96f9b 100644
--- a/packages/desktop-client/src/app/appSlice.ts
+++ b/packages/desktop-client/src/app/appSlice.ts
@@ -1,7 +1,7 @@
import { createAction, createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getUploadError } from 'loot-core/shared/errors';
import type { AccountEntity } from 'loot-core/types/models';
import type { AtLeastOne } from 'loot-core/types/util';
diff --git a/packages/desktop-client/src/budget/mutations.ts b/packages/desktop-client/src/budget/mutations.ts
index a19fefc344..948c6016f6 100644
--- a/packages/desktop-client/src/budget/mutations.ts
+++ b/packages/desktop-client/src/budget/mutations.ts
@@ -5,8 +5,8 @@ import type { QueryClient, QueryKey } from '@tanstack/react-query';
import type { TFunction } from 'i18next';
import { v4 as uuidv4 } from 'uuid';
-import { sendCatch } from 'loot-core/platform/client/fetch';
-import type { send } from 'loot-core/platform/client/fetch';
+import { sendCatch } from 'loot-core/platform/client/connection';
+import type { send } from 'loot-core/platform/client/connection';
import { logger } from 'loot-core/platform/server/log';
import type { IntegerAmount } from 'loot-core/shared/util';
import type {
diff --git a/packages/desktop-client/src/budget/queries.ts b/packages/desktop-client/src/budget/queries.ts
index c1dd4da8d5..501ea0fe6a 100644
--- a/packages/desktop-client/src/budget/queries.ts
+++ b/packages/desktop-client/src/budget/queries.ts
@@ -1,7 +1,7 @@
import { queryOptions } from '@tanstack/react-query';
import i18n from 'i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type {
CategoryEntity,
CategoryGroupEntity,
diff --git a/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts b/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts
index 02559f1ce3..7571c6151f 100644
--- a/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts
+++ b/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts
@@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
import { t } from 'i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { RemoteFile } from 'loot-core/server/cloud-storage';
import { getDownloadError, getSyncError } from 'loot-core/shared/errors';
import type { Budget } from 'loot-core/types/budget';
diff --git a/packages/desktop-client/src/components/App.tsx b/packages/desktop-client/src/components/App.tsx
index c68c251f88..264d2ca813 100644
--- a/packages/desktop-client/src/components/App.tsx
+++ b/packages/desktop-client/src/components/App.tsx
@@ -12,7 +12,10 @@ import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
import { useQueryClient } from '@tanstack/react-query';
-import { init as initConnection, send } from 'loot-core/platform/client/fetch';
+import {
+ init as initConnection,
+ send,
+} from 'loot-core/platform/client/connection';
import { AppBackground } from './AppBackground';
import { BudgetMonthCountProvider } from './budget/BudgetMonthCountContext';
@@ -73,10 +76,7 @@ function AppInner() {
};
async function init() {
- const serverSocket = await maybeUpdate(() =>
- global.Actual.getServerSocket(),
- );
-
+ await maybeUpdate();
dispatch(
setAppState({
loadingText: t(
@@ -84,7 +84,7 @@ function AppInner() {
),
}),
);
- await initConnection(serverSocket);
+ await initConnection();
// Load any global prefs
dispatch(
diff --git a/packages/desktop-client/src/components/LoggedInUser.tsx b/packages/desktop-client/src/components/LoggedInUser.tsx
index 139715fbec..c386b4f6a8 100644
--- a/packages/desktop-client/src/components/LoggedInUser.tsx
+++ b/packages/desktop-client/src/components/LoggedInUser.tsx
@@ -11,7 +11,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import type { RemoteFile, SyncedLocalFile } from 'loot-core/types/file';
import type { TransObjectLiteral } from 'loot-core/types/util';
diff --git a/packages/desktop-client/src/components/ManageRules.tsx b/packages/desktop-client/src/components/ManageRules.tsx
index 6d9aa2d785..6bda42336b 100644
--- a/packages/desktop-client/src/components/ManageRules.tsx
+++ b/packages/desktop-client/src/components/ManageRules.tsx
@@ -10,7 +10,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import { getNormalisedString } from 'loot-core/shared/normalisation';
import { q } from 'loot-core/shared/query';
diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx
index f3ba35003e..f73223f057 100644
--- a/packages/desktop-client/src/components/Modals.tsx
+++ b/packages/desktop-client/src/components/Modals.tsx
@@ -2,7 +2,7 @@
import React, { Fragment, useEffect, useEffectEvent } from 'react';
import { useLocation } from 'react-router';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { EditSyncAccount } from './banksync/EditSyncAccount';
diff --git a/packages/desktop-client/src/components/NotesButton.tsx b/packages/desktop-client/src/components/NotesButton.tsx
index 37df698738..907756e011 100644
--- a/packages/desktop-client/src/components/NotesButton.tsx
+++ b/packages/desktop-client/src/components/NotesButton.tsx
@@ -10,7 +10,7 @@ import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
import { css, cx } from '@emotion/css';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { Notes } from './Notes';
diff --git a/packages/desktop-client/src/components/ServerContext.tsx b/packages/desktop-client/src/components/ServerContext.tsx
index f74c4945b5..ea6f49edf5 100644
--- a/packages/desktop-client/src/components/ServerContext.tsx
+++ b/packages/desktop-client/src/components/ServerContext.tsx
@@ -9,7 +9,7 @@ import type { ReactNode } from 'react';
import { t } from 'i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Handlers } from 'loot-core/types/handlers';
import { addNotification } from '@desktop-client/notifications/notificationsSlice';
diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx
index 281ec54eb8..c82a96a8ee 100644
--- a/packages/desktop-client/src/components/Titlebar.tsx
+++ b/packages/desktop-client/src/components/Titlebar.tsx
@@ -20,7 +20,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import { isDevelopmentEnvironment } from 'loot-core/shared/environment';
import * as Platform from 'loot-core/shared/platform';
diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx
index 6f72882621..44dd9d95b1 100644
--- a/packages/desktop-client/src/components/accounts/Account.tsx
+++ b/packages/desktop-client/src/components/accounts/Account.tsx
@@ -11,7 +11,7 @@ import debounce from 'lodash/debounce';
import isEqual from 'lodash/isEqual';
import { v4 as uuidv4 } from 'uuid';
-import { listen, send } from 'loot-core/platform/client/fetch';
+import { listen, send } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import type { UndoState } from 'loot-core/server/undo';
import { currentDay } from 'loot-core/shared/months';
diff --git a/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx b/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx
index 7479e0b508..2fd540d1f0 100644
--- a/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx
+++ b/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx
@@ -11,7 +11,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import type { Handlers } from 'loot-core/types/handlers';
import type { UserAccessEntity, UserAvailable } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx b/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx
index 8c7134595e..b8ddeda905 100644
--- a/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx
+++ b/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getUserAccessErrors } from 'loot-core/shared/errors';
import type { UserAvailable } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx
index f706fec93f..d73d168c76 100644
--- a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx
+++ b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx
@@ -10,7 +10,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import type { NewUserEntity, UserEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx
index 34c50ae170..008edfe2ab 100644
--- a/packages/desktop-client/src/components/budget/index.tsx
+++ b/packages/desktop-client/src/components/budget/index.tsx
@@ -5,7 +5,7 @@ import type { ComponentType } from 'react';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
CategoryEntity,
diff --git a/packages/desktop-client/src/components/budget/util.ts b/packages/desktop-client/src/components/budget/util.ts
index 0909dd3c44..61fc8cb75e 100644
--- a/packages/desktop-client/src/components/budget/util.ts
+++ b/packages/desktop-client/src/components/budget/util.ts
@@ -5,7 +5,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { t } from 'i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { currencyToAmount, integerToCurrency } from 'loot-core/shared/util';
import type { Handlers } from 'loot-core/types/handlers';
diff --git a/packages/desktop-client/src/components/filters/FiltersMenu.tsx b/packages/desktop-client/src/components/filters/FiltersMenu.tsx
index 66bc18b092..7aa1316e91 100644
--- a/packages/desktop-client/src/components/filters/FiltersMenu.tsx
+++ b/packages/desktop-client/src/components/filters/FiltersMenu.tsx
@@ -20,7 +20,7 @@ import {
parse as parseDate,
} from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getMonthYearFormat } from 'loot-core/shared/months';
import {
deserializeField,
diff --git a/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx b/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx
index eff3df2b6c..1b91769369 100644
--- a/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx
+++ b/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx
@@ -7,7 +7,7 @@ import { Popover } from '@actual-app/components/popover';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { send, sendCatch } from 'loot-core/platform/client/fetch';
+import { send, sendCatch } from 'loot-core/platform/client/connection';
import type {
RuleConditionEntity,
TransactionFilterEntity,
diff --git a/packages/desktop-client/src/components/formula/QueryManager.tsx b/packages/desktop-client/src/components/formula/QueryManager.tsx
index 196c901423..eda8dadbbb 100644
--- a/packages/desktop-client/src/components/formula/QueryManager.tsx
+++ b/packages/desktop-client/src/components/formula/QueryManager.tsx
@@ -14,7 +14,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { parseISO } from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { RuleConditionEntity, TimeFrame } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx
index 31a0a82e93..e22e38bc5d 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx
@@ -8,7 +8,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { Title, useBootstrapped } from './common';
import { ConfirmPasswordForm } from './ConfirmPasswordForm';
diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
index b31aa10a2a..fe8e4976ed 100644
--- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
@@ -7,7 +7,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { Title } from './common';
import { ConfirmPasswordForm } from './ConfirmPasswordForm';
diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.tsx b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
index 2e72ccc9c3..d363b281a8 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Login.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
@@ -15,7 +15,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { isElectron } from 'loot-core/shared/environment';
import type { OpenIdConfig } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/manager/subscribe/OpenIdCallback.ts b/packages/desktop-client/src/components/manager/subscribe/OpenIdCallback.ts
index db81a83c43..86be63a8c8 100644
--- a/packages/desktop-client/src/components/manager/subscribe/OpenIdCallback.ts
+++ b/packages/desktop-client/src/components/manager/subscribe/OpenIdCallback.ts
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { useDispatch } from '@desktop-client/redux';
import { loggedIn } from '@desktop-client/users/usersSlice';
diff --git a/packages/desktop-client/src/components/manager/subscribe/common.tsx b/packages/desktop-client/src/components/manager/subscribe/common.tsx
index 9bac26d7f7..542144767b 100644
--- a/packages/desktop-client/src/components/manager/subscribe/common.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/common.tsx
@@ -4,7 +4,7 @@ import { useLocation } from 'react-router';
import { theme } from '@actual-app/components/theme';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Handlers } from 'loot-core/types/handlers';
import {
diff --git a/packages/desktop-client/src/components/mobile/accounts/AccountPage.tsx b/packages/desktop-client/src/components/mobile/accounts/AccountPage.tsx
index 4879c85e5c..1d94148804 100644
--- a/packages/desktop-client/src/components/mobile/accounts/AccountPage.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/AccountPage.tsx
@@ -9,7 +9,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { AccountEntity } from 'loot-core/types/models';
import { AccountTransactions } from './AccountTransactions';
diff --git a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx
index 2713ed15b7..344d2bfa1b 100644
--- a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
import { isPreviewId } from 'loot-core/shared/transactions';
import type { IntegerAmount } from 'loot-core/shared/util';
diff --git a/packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx b/packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx
index 64ac883b40..cd5c46eb89 100644
--- a/packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx
@@ -1,7 +1,7 @@
import React, { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
import { isPreviewId } from 'loot-core/shared/transactions';
import type { TransactionEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx b/packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx
index f5b2a6b602..c9f37e5259 100644
--- a/packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx
@@ -1,7 +1,7 @@
import React, { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
import { isPreviewId } from 'loot-core/shared/transactions';
import type { ScheduleEntity, TransactionEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx b/packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx
index 466e1e799d..cd84243927 100644
--- a/packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx
@@ -1,7 +1,7 @@
import React, { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
import { isPreviewId } from 'loot-core/shared/transactions';
import type { ScheduleEntity, TransactionEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx b/packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
index 703cf0f4f1..5c9456d461 100644
--- a/packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
+++ b/packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
@@ -27,7 +27,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { groupById } from 'loot-core/shared/util';
import type { TransObjectLiteral } from 'loot-core/types/util';
diff --git a/packages/desktop-client/src/components/mobile/payees/MobilePayeeEditPage.tsx b/packages/desktop-client/src/components/mobile/payees/MobilePayeeEditPage.tsx
index 949037a7ad..14e7fedcfe 100644
--- a/packages/desktop-client/src/components/mobile/payees/MobilePayeeEditPage.tsx
+++ b/packages/desktop-client/src/components/mobile/payees/MobilePayeeEditPage.tsx
@@ -8,7 +8,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { PayeeEntity } from 'loot-core/types/models';
import { MobileBackButton } from '@desktop-client/components/mobile/MobileBackButton';
diff --git a/packages/desktop-client/src/components/mobile/payees/MobilePayeesPage.tsx b/packages/desktop-client/src/components/mobile/payees/MobilePayeesPage.tsx
index 5e05e234ea..29fc633329 100644
--- a/packages/desktop-client/src/components/mobile/payees/MobilePayeesPage.tsx
+++ b/packages/desktop-client/src/components/mobile/payees/MobilePayeesPage.tsx
@@ -5,7 +5,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getNormalisedString } from 'loot-core/shared/normalisation';
import type { PayeeEntity, RuleEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/mobile/rules/MobileRuleEditPage.tsx b/packages/desktop-client/src/components/mobile/rules/MobileRuleEditPage.tsx
index 25652d8b07..4fe9eef1af 100644
--- a/packages/desktop-client/src/components/mobile/rules/MobileRuleEditPage.tsx
+++ b/packages/desktop-client/src/components/mobile/rules/MobileRuleEditPage.tsx
@@ -6,7 +6,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import type { NewRuleEntity, RuleEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx b/packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
index a24cd7eb26..9d6aaccc98 100644
--- a/packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
+++ b/packages/desktop-client/src/components/mobile/rules/MobileRulesPage.tsx
@@ -5,7 +5,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { listen, send } from 'loot-core/platform/client/fetch';
+import { listen, send } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import { getNormalisedString } from 'loot-core/shared/normalisation';
import { q } from 'loot-core/shared/query';
diff --git a/packages/desktop-client/src/components/mobile/schedules/MobileScheduleEditPage.tsx b/packages/desktop-client/src/components/mobile/schedules/MobileScheduleEditPage.tsx
index 3b9b5e1996..532e411ef2 100644
--- a/packages/desktop-client/src/components/mobile/schedules/MobileScheduleEditPage.tsx
+++ b/packages/desktop-client/src/components/mobile/schedules/MobileScheduleEditPage.tsx
@@ -9,7 +9,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send, sendCatch } from 'loot-core/platform/client/fetch';
+import { send, sendCatch } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type { RecurConfig, ScheduleEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/mobile/schedules/MobileSchedulesPage.tsx b/packages/desktop-client/src/components/mobile/schedules/MobileSchedulesPage.tsx
index 39ca90bf6f..8a5a560226 100644
--- a/packages/desktop-client/src/components/mobile/schedules/MobileSchedulesPage.tsx
+++ b/packages/desktop-client/src/components/mobile/schedules/MobileSchedulesPage.tsx
@@ -6,7 +6,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { format as monthUtilFormat } from 'loot-core/shared/months';
import { getNormalisedString } from 'loot-core/shared/normalisation';
import { q } from 'loot-core/shared/query';
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
index 14354550ac..db5e3a4c0b 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx
@@ -30,7 +30,7 @@ import {
parseISO,
} from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import * as Platform from 'loot-core/shared/platform';
import { q } from 'loot-core/shared/query';
diff --git a/packages/desktop-client/src/components/modals/BudgetAutomationsModal.tsx b/packages/desktop-client/src/components/modals/BudgetAutomationsModal.tsx
index 7137854d74..58c727ce93 100644
--- a/packages/desktop-client/src/components/modals/BudgetAutomationsModal.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetAutomationsModal.tsx
@@ -9,7 +9,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import uniqueId from 'lodash/uniqueId';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import type {
CategoryGroupEntity,
diff --git a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx
index 5fd3a46e51..a6fe649480 100644
--- a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx
+++ b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx
@@ -12,7 +12,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { useAuth } from '@desktop-client/auth/AuthProvider';
import { Permissions } from '@desktop-client/auth/types';
diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx b/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx
index 078719263f..c9fb940dd4 100644
--- a/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx
+++ b/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx
@@ -14,7 +14,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getCreateKeyError } from 'loot-core/shared/errors';
import { sync } from '@desktop-client/app/appSlice';
diff --git a/packages/desktop-client/src/components/modals/EditAccess.tsx b/packages/desktop-client/src/components/modals/EditAccess.tsx
index f95c551ac5..1825f4a91a 100644
--- a/packages/desktop-client/src/components/modals/EditAccess.tsx
+++ b/packages/desktop-client/src/components/modals/EditAccess.tsx
@@ -9,7 +9,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getUserAccessErrors } from 'loot-core/shared/errors';
import {
diff --git a/packages/desktop-client/src/components/modals/EditUser.tsx b/packages/desktop-client/src/components/modals/EditUser.tsx
index cf98b6b27d..ad69e875be 100644
--- a/packages/desktop-client/src/components/modals/EditUser.tsx
+++ b/packages/desktop-client/src/components/modals/EditUser.tsx
@@ -10,7 +10,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { PossibleRoles } from 'loot-core/shared/user';
import type { NewUserEntity, UserEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx b/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx
index 893e3eb530..5bbd17a682 100644
--- a/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx
+++ b/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx
@@ -13,7 +13,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getTestKeyError } from 'loot-core/shared/errors';
import { Link } from '@desktop-client/components/common/Link';
diff --git a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
index 8312cb8b28..19b2458b0d 100644
--- a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
+++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
@@ -8,7 +8,7 @@ import { Paragraph } from '@actual-app/components/paragraph';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { sendCatch } from 'loot-core/platform/client/fetch';
+import { sendCatch } from 'loot-core/platform/client/connection';
import type {
GoCardlessInstitution,
GoCardlessToken,
diff --git a/packages/desktop-client/src/components/modals/GoCardlessInitialiseModal.tsx b/packages/desktop-client/src/components/modals/GoCardlessInitialiseModal.tsx
index b887919995..d925861217 100644
--- a/packages/desktop-client/src/components/modals/GoCardlessInitialiseModal.tsx
+++ b/packages/desktop-client/src/components/modals/GoCardlessInitialiseModal.tsx
@@ -8,7 +8,7 @@ import { Input } from '@actual-app/components/input';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getSecretsError } from 'loot-core/shared/errors';
import { Error } from '@desktop-client/components/alerts';
diff --git a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
index 8b20cbacba..cf1af04fa3 100644
--- a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
+++ b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
@@ -12,7 +12,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { ParseFileOptions } from 'loot-core/server/transactions/import/parse-file';
import { amountToInteger } from 'loot-core/shared/util';
diff --git a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx
index cbf0edda03..cd5cc02849 100644
--- a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx
+++ b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx
@@ -7,7 +7,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { listen, send } from 'loot-core/platform/client/fetch';
+import { listen, send } from 'loot-core/platform/client/connection';
import type { Backup } from 'loot-core/server/budgetfiles/backups';
import {
diff --git a/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx b/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
index 45f6e5be6c..4e72b2636d 100644
--- a/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
+++ b/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
@@ -7,7 +7,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { PayeeEntity } from 'loot-core/types/models';
import type { TransObjectLiteral } from 'loot-core/types/util';
diff --git a/packages/desktop-client/src/components/modals/OpenIDEnableModal.tsx b/packages/desktop-client/src/components/modals/OpenIDEnableModal.tsx
index 1d5e5cad1c..eff81804f0 100644
--- a/packages/desktop-client/src/components/modals/OpenIDEnableModal.tsx
+++ b/packages/desktop-client/src/components/modals/OpenIDEnableModal.tsx
@@ -7,7 +7,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as asyncStorage from 'loot-core/platform/server/asyncStorage';
import { getOpenIdErrors } from 'loot-core/shared/errors';
import type { OpenIdConfig } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/modals/PasswordEnableModal.tsx b/packages/desktop-client/src/components/modals/PasswordEnableModal.tsx
index 85856d5894..801ad1f4f5 100644
--- a/packages/desktop-client/src/components/modals/PasswordEnableModal.tsx
+++ b/packages/desktop-client/src/components/modals/PasswordEnableModal.tsx
@@ -7,7 +7,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as asyncStorage from 'loot-core/platform/server/asyncStorage';
import { closeBudget } from '@desktop-client/budgetfiles/budgetfilesSlice';
diff --git a/packages/desktop-client/src/components/modals/PluggyAiInitialiseModal.tsx b/packages/desktop-client/src/components/modals/PluggyAiInitialiseModal.tsx
index b050f8d017..8c8ceb153a 100644
--- a/packages/desktop-client/src/components/modals/PluggyAiInitialiseModal.tsx
+++ b/packages/desktop-client/src/components/modals/PluggyAiInitialiseModal.tsx
@@ -8,7 +8,7 @@ import { Input } from '@actual-app/components/input';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getSecretsError } from 'loot-core/shared/errors';
import { Error } from '@desktop-client/components/alerts';
diff --git a/packages/desktop-client/src/components/modals/SimpleFinInitialiseModal.tsx b/packages/desktop-client/src/components/modals/SimpleFinInitialiseModal.tsx
index bd0fd9f693..fef7e54d18 100644
--- a/packages/desktop-client/src/components/modals/SimpleFinInitialiseModal.tsx
+++ b/packages/desktop-client/src/components/modals/SimpleFinInitialiseModal.tsx
@@ -7,7 +7,7 @@ import { Input } from '@actual-app/components/input';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getSecretsError } from 'loot-core/shared/errors';
import { Error } from '@desktop-client/components/alerts';
diff --git a/packages/desktop-client/src/components/modals/TransferOwnership.tsx b/packages/desktop-client/src/components/modals/TransferOwnership.tsx
index 8d206b5324..9973384660 100644
--- a/packages/desktop-client/src/components/modals/TransferOwnership.tsx
+++ b/packages/desktop-client/src/components/modals/TransferOwnership.tsx
@@ -9,7 +9,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { getUserAccessErrors } from 'loot-core/shared/errors';
import type { Budget } from 'loot-core/types/budget';
import type { RemoteFile, SyncedLocalFile } from 'loot-core/types/file';
diff --git a/packages/desktop-client/src/components/modals/UnmigrateBudgetAutomationsModal.tsx b/packages/desktop-client/src/components/modals/UnmigrateBudgetAutomationsModal.tsx
index f180486749..6b1f669f89 100644
--- a/packages/desktop-client/src/components/modals/UnmigrateBudgetAutomationsModal.tsx
+++ b/packages/desktop-client/src/components/modals/UnmigrateBudgetAutomationsModal.tsx
@@ -6,7 +6,7 @@ import { AnimatedLoading } from '@actual-app/components/icons/AnimatedLoading';
import { SpaceBetween } from '@actual-app/components/space-between';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Template } from 'loot-core/types/models/templates';
import { Link } from '@desktop-client/components/common/Link';
diff --git a/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx b/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
index 95b0f2c0d1..885059846c 100644
--- a/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/DuplicateFileModal.tsx
@@ -10,7 +10,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { duplicateBudget } from '@desktop-client/budgetfiles/budgetfilesSlice';
import {
diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx b/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx
index 19b805230c..1d6fe05e15 100644
--- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx
+++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx
@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useState } from 'react';
-import { listen, send } from 'loot-core/platform/client/fetch';
+import { listen, send } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import type { UndoState } from 'loot-core/server/undo';
import { applyChanges } from 'loot-core/shared/util';
diff --git a/packages/desktop-client/src/components/reports/DashboardHeader.tsx b/packages/desktop-client/src/components/reports/DashboardHeader.tsx
index 84f6785869..753f886ecc 100644
--- a/packages/desktop-client/src/components/reports/DashboardHeader.tsx
+++ b/packages/desktop-client/src/components/reports/DashboardHeader.tsx
@@ -8,7 +8,7 @@ import { Input } from '@actual-app/components/input';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { DashboardEntity } from 'loot-core/types/models';
type DashboardHeaderProps = {
diff --git a/packages/desktop-client/src/components/reports/DashboardSelector.tsx b/packages/desktop-client/src/components/reports/DashboardSelector.tsx
index 21e2572b6c..d98ac748a7 100644
--- a/packages/desktop-client/src/components/reports/DashboardSelector.tsx
+++ b/packages/desktop-client/src/components/reports/DashboardSelector.tsx
@@ -8,7 +8,7 @@ import { Menu } from '@actual-app/components/menu';
import { Popover } from '@actual-app/components/popover';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { DashboardEntity } from 'loot-core/types/models';
import { useNavigate } from '@desktop-client/hooks/useNavigate';
diff --git a/packages/desktop-client/src/components/reports/Overview.tsx b/packages/desktop-client/src/components/reports/Overview.tsx
index a103d64461..f864c827f3 100644
--- a/packages/desktop-client/src/components/reports/Overview.tsx
+++ b/packages/desktop-client/src/components/reports/Overview.tsx
@@ -14,7 +14,7 @@ import { Popover } from '@actual-app/components/popover';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type {
CustomReportWidget,
DashboardEntity,
diff --git a/packages/desktop-client/src/components/reports/SaveReport.tsx b/packages/desktop-client/src/components/reports/SaveReport.tsx
index b2157d477e..6138c830dc 100644
--- a/packages/desktop-client/src/components/reports/SaveReport.tsx
+++ b/packages/desktop-client/src/components/reports/SaveReport.tsx
@@ -9,7 +9,7 @@ import { SpaceBetween } from '@actual-app/components/space-between';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type {
CustomReportEntity,
DashboardEntity,
diff --git a/packages/desktop-client/src/components/reports/reports/BudgetAnalysis.tsx b/packages/desktop-client/src/components/reports/reports/BudgetAnalysis.tsx
index 8945856889..4ece950aa2 100644
--- a/packages/desktop-client/src/components/reports/reports/BudgetAnalysis.tsx
+++ b/packages/desktop-client/src/components/reports/reports/BudgetAnalysis.tsx
@@ -13,7 +13,7 @@ import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
BudgetAnalysisWidget,
diff --git a/packages/desktop-client/src/components/reports/reports/Calendar.tsx b/packages/desktop-client/src/components/reports/reports/Calendar.tsx
index 6f2394de94..5c91582535 100644
--- a/packages/desktop-client/src/components/reports/reports/Calendar.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Calendar.tsx
@@ -19,7 +19,7 @@ import { css } from '@emotion/css';
import { useDrag } from '@use-gesture/react';
import { format as formatDate, parseISO } from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type { Query } from 'loot-core/shared/query';
diff --git a/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx b/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx
index 9974d1fc0c..8b4832250e 100644
--- a/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx
@@ -22,7 +22,7 @@ import { View } from '@actual-app/components/view';
import { format as formatDate } from 'date-fns';
import debounce from 'lodash/debounce';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { CalendarWidget } from 'loot-core/types/models';
import type { SyncedPrefs } from 'loot-core/types/prefs';
diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
index a051e3d303..76571520ad 100644
--- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
@@ -12,7 +12,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
CashFlowWidget,
diff --git a/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx b/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx
index 5a405a14b8..34aa80219a 100644
--- a/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx
@@ -6,7 +6,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { Bar, BarChart, LabelList } from 'recharts';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { CashFlowWidget } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/reports/Crossover.tsx b/packages/desktop-client/src/components/reports/reports/Crossover.tsx
index 3df62dfe25..4265cf15b7 100644
--- a/packages/desktop-client/src/components/reports/reports/Crossover.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Crossover.tsx
@@ -15,7 +15,7 @@ import { theme } from '@actual-app/components/theme';
import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
CategoryEntity,
diff --git a/packages/desktop-client/src/components/reports/reports/CrossoverCard.tsx b/packages/desktop-client/src/components/reports/reports/CrossoverCard.tsx
index ea0d51755d..2ab41b902c 100644
--- a/packages/desktop-client/src/components/reports/reports/CrossoverCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CrossoverCard.tsx
@@ -7,7 +7,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { AccountEntity, CrossoverWidget } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
index 0ee7853b19..ecfa6da778 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
@@ -11,7 +11,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
balanceTypeOpType,
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx
index 47c94defe4..0b3312c3e1 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx
@@ -8,7 +8,7 @@ import { theme } from '@actual-app/components/theme';
import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { CustomReportEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/reports/Formula.tsx b/packages/desktop-client/src/components/reports/reports/Formula.tsx
index 591916ce37..7d7b9d4206 100644
--- a/packages/desktop-client/src/components/reports/reports/Formula.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Formula.tsx
@@ -11,7 +11,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { FormulaWidget } from 'loot-core/types/models';
import { EditablePageHeaderTitle } from '@desktop-client/components/EditablePageHeaderTitle';
diff --git a/packages/desktop-client/src/components/reports/reports/NetWorth.tsx b/packages/desktop-client/src/components/reports/reports/NetWorth.tsx
index 1f4af9efd7..86213b5228 100644
--- a/packages/desktop-client/src/components/reports/reports/NetWorth.tsx
+++ b/packages/desktop-client/src/components/reports/reports/NetWorth.tsx
@@ -19,7 +19,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { NetWorthWidget, TimeFrame } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx
index 594e21ecce..584eb22317 100644
--- a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx
@@ -6,7 +6,7 @@ import { useResponsive } from '@actual-app/components/hooks/useResponsive';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { AccountEntity, NetWorthWidget } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/reports/Spending.tsx b/packages/desktop-client/src/components/reports/reports/Spending.tsx
index 8c07c5dd00..6aa4f423af 100644
--- a/packages/desktop-client/src/components/reports/reports/Spending.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Spending.tsx
@@ -16,7 +16,7 @@ import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
RuleConditionEntity,
diff --git a/packages/desktop-client/src/components/reports/reports/Summary.tsx b/packages/desktop-client/src/components/reports/reports/Summary.tsx
index cb73830f60..4a6149ea96 100644
--- a/packages/desktop-client/src/components/reports/reports/Summary.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Summary.tsx
@@ -16,7 +16,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { parseISO } from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
SummaryContent,
diff --git a/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx b/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx
index 521b974726..129203f845 100644
--- a/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { SummaryContent, SummaryWidget } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/budget-analysis-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/budget-analysis-spreadsheet.ts
index 681be70ec6..c253c02f81 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/budget-analysis-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/budget-analysis-spreadsheet.ts
@@ -1,5 +1,5 @@
// @ts-strict-ignore
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
CategoryEntity,
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/calendar-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/calendar-spreadsheet.ts
index 21ca8395c5..7a8c33fabf 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/calendar-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/calendar-spreadsheet.ts
@@ -1,6 +1,6 @@
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type { RuleConditionEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
index ebb0418e9e..d97e490823 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
+++ b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx
@@ -6,7 +6,7 @@ import type { Locale } from 'date-fns';
import * as d from 'date-fns';
import { t } from 'i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type { RuleConditionEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts
index 5928a4be08..e12711e73f 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts
@@ -1,6 +1,6 @@
import * as d from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type {
AccountEntity,
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts
index 1371a31c67..051c07d811 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts
@@ -1,4 +1,4 @@
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import type { GroupedEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/net-worth-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/net-worth-spreadsheet.ts
index f9f97d21bf..44a695327c 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/net-worth-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/net-worth-spreadsheet.ts
@@ -2,7 +2,7 @@ import * as d from 'date-fns';
import type { Locale } from 'date-fns';
import keyBy from 'lodash/keyBy';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type {
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts
index eafdced74f..1e0a05eac1 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import keyBy from 'lodash/keyBy';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type {
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/summary-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/summary-spreadsheet.ts
index feb5a65c33..530b93add7 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/summary-spreadsheet.ts
+++ b/packages/desktop-client/src/components/reports/spreadsheets/summary-spreadsheet.ts
@@ -1,7 +1,7 @@
import * as d from 'date-fns';
import type { Locale } from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type {
diff --git a/packages/desktop-client/src/components/rules/RuleEditor.tsx b/packages/desktop-client/src/components/rules/RuleEditor.tsx
index 798fbbd28b..0626dd2ed4 100644
--- a/packages/desktop-client/src/components/rules/RuleEditor.tsx
+++ b/packages/desktop-client/src/components/rules/RuleEditor.tsx
@@ -25,7 +25,7 @@ import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
import { v4 as uuid } from 'uuid';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import {
diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
index dde07cb9a8..28e235121f 100644
--- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
+++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
@@ -9,7 +9,7 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import { getRecurringDescription } from 'loot-core/shared/schedules';
import type { DiscoverScheduleEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx
index d4b49178f4..2d6ff13515 100644
--- a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx
+++ b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx
@@ -8,7 +8,7 @@ import { SpaceBetween } from '@actual-app/components/space-between';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { PayeeEntity } from 'loot-core/types/models';
import {
diff --git a/packages/desktop-client/src/components/schedules/ScheduleEditModal.tsx b/packages/desktop-client/src/components/schedules/ScheduleEditModal.tsx
index fa5d6467c5..3e67779894 100644
--- a/packages/desktop-client/src/components/schedules/ScheduleEditModal.tsx
+++ b/packages/desktop-client/src/components/schedules/ScheduleEditModal.tsx
@@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { SpaceBetween } from '@actual-app/components/space-between';
-import { send, sendCatch } from 'loot-core/platform/client/fetch';
+import { send, sendCatch } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type { RecurConfig, ScheduleEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx
index 0e11395114..43bf4e481a 100644
--- a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx
+++ b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx
@@ -8,7 +8,7 @@ import { InitialFocus } from '@actual-app/components/initial-focus';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import { ROW_HEIGHT, SchedulesTable } from './SchedulesTable';
diff --git a/packages/desktop-client/src/components/schedules/index.tsx b/packages/desktop-client/src/components/schedules/index.tsx
index 8512979733..16331e6795 100644
--- a/packages/desktop-client/src/components/schedules/index.tsx
+++ b/packages/desktop-client/src/components/schedules/index.tsx
@@ -5,7 +5,7 @@ import { Button } from '@actual-app/components/button';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import type { ScheduleEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx b/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx
index e14a455041..5d6f0976f6 100644
--- a/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx
+++ b/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx
@@ -15,7 +15,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { sendCatch } from 'loot-core/platform/client/fetch';
+import { sendCatch } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { getRecurringDescription } from 'loot-core/shared/schedules';
import type { RecurConfig, RecurPattern } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx b/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
index b359ba8d1d..632c541054 100644
--- a/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
+++ b/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
@@ -4,7 +4,7 @@ import { Trans } from 'react-i18next';
import { ButtonWithLoading } from '@actual-app/components/button';
import { Text } from '@actual-app/components/text';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { Setting } from './UI';
diff --git a/packages/desktop-client/src/components/settings/Export.tsx b/packages/desktop-client/src/components/settings/Export.tsx
index 529b8da2e2..bbcf842ae7 100644
--- a/packages/desktop-client/src/components/settings/Export.tsx
+++ b/packages/desktop-client/src/components/settings/Export.tsx
@@ -7,7 +7,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { format } from 'date-fns';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { Setting } from './UI';
diff --git a/packages/desktop-client/src/components/settings/RepairTransactions.tsx b/packages/desktop-client/src/components/settings/RepairTransactions.tsx
index 9f3977bce8..756ba15f84 100644
--- a/packages/desktop-client/src/components/settings/RepairTransactions.tsx
+++ b/packages/desktop-client/src/components/settings/RepairTransactions.tsx
@@ -7,7 +7,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Handlers } from 'loot-core/types/handlers';
import { Setting } from './UI';
diff --git a/packages/desktop-client/src/components/settings/Reset.tsx b/packages/desktop-client/src/components/settings/Reset.tsx
index 5166a6b025..740382f266 100644
--- a/packages/desktop-client/src/components/settings/Reset.tsx
+++ b/packages/desktop-client/src/components/settings/Reset.tsx
@@ -4,7 +4,7 @@ import { Trans } from 'react-i18next';
import { ButtonWithLoading } from '@actual-app/components/button';
import { Text } from '@actual-app/components/text';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { Setting } from './UI';
diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx
index 7d29fa012b..bbcef287b5 100644
--- a/packages/desktop-client/src/components/settings/index.tsx
+++ b/packages/desktop-client/src/components/settings/index.tsx
@@ -11,7 +11,7 @@ import { tokens } from '@actual-app/components/tokens';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import { isElectron } from 'loot-core/shared/environment';
import { AuthSettings } from './AuthSettings';
diff --git a/packages/desktop-client/src/components/transactions/TransactionList.tsx b/packages/desktop-client/src/components/transactions/TransactionList.tsx
index 14f08e4057..dd92ba92cc 100644
--- a/packages/desktop-client/src/components/transactions/TransactionList.tsx
+++ b/packages/desktop-client/src/components/transactions/TransactionList.tsx
@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
import { theme } from '@actual-app/components/theme';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import { getUpcomingDays } from 'loot-core/shared/schedules';
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx b/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
index cb99ab5f95..0940a4c105 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
@@ -10,7 +10,7 @@ import {
generateCategoryGroups,
generateTransaction,
} from 'loot-core/mocks';
-import { initServer } from 'loot-core/platform/client/fetch';
+import { initServer } from 'loot-core/platform/client/connection';
import {
addSplitTransaction,
realizeTempTransactions,
@@ -35,7 +35,7 @@ import { SplitsExpandedProvider } from '@desktop-client/hooks/useSplitsExpanded'
import { SpreadsheetProvider } from '@desktop-client/hooks/useSpreadsheet';
import { TestProviders } from '@desktop-client/mocks';
-vi.mock('loot-core/platform/client/fetch');
+vi.mock('loot-core/platform/client/connection');
vi.mock('../../hooks/useFeatureFlag', () => ({
default: vi.fn().mockReturnValue(false),
}));
diff --git a/packages/desktop-client/src/global-events.ts b/packages/desktop-client/src/global-events.ts
index 258c52e10a..b1039233d4 100644
--- a/packages/desktop-client/src/global-events.ts
+++ b/packages/desktop-client/src/global-events.ts
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import type { QueryClient } from '@tanstack/react-query';
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import { reloadAccounts } from './accounts/accountsSlice';
diff --git a/packages/desktop-client/src/gocardless.ts b/packages/desktop-client/src/gocardless.ts
index 33b36cf055..7c2383d6b0 100644
--- a/packages/desktop-client/src/gocardless.ts
+++ b/packages/desktop-client/src/gocardless.ts
@@ -1,4 +1,4 @@
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { GoCardlessToken } from 'loot-core/types/models';
import { pushModal } from './modals/modalsSlice';
diff --git a/packages/desktop-client/src/hooks/useBudgetAutomations.ts b/packages/desktop-client/src/hooks/useBudgetAutomations.ts
index 406ca1c918..5a6cac6a3b 100644
--- a/packages/desktop-client/src/hooks/useBudgetAutomations.ts
+++ b/packages/desktop-client/src/hooks/useBudgetAutomations.ts
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Template } from 'loot-core/types/models/templates';
export function useBudgetAutomations({
diff --git a/packages/desktop-client/src/hooks/useFormulaExecution.ts b/packages/desktop-client/src/hooks/useFormulaExecution.ts
index 8fb74617b7..564d9b4eef 100644
--- a/packages/desktop-client/src/hooks/useFormulaExecution.ts
+++ b/packages/desktop-client/src/hooks/useFormulaExecution.ts
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import { HyperFormula } from 'hyperformula';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import type { Query } from 'loot-core/shared/query';
diff --git a/packages/desktop-client/src/hooks/useGoCardlessStatus.ts b/packages/desktop-client/src/hooks/useGoCardlessStatus.ts
index 2ba8058dfd..3e06477fda 100644
--- a/packages/desktop-client/src/hooks/useGoCardlessStatus.ts
+++ b/packages/desktop-client/src/hooks/useGoCardlessStatus.ts
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { useSyncServerStatus } from './useSyncServerStatus';
diff --git a/packages/desktop-client/src/hooks/usePayeeRuleCounts.ts b/packages/desktop-client/src/hooks/usePayeeRuleCounts.ts
index cacfd3ac39..349d4aaded 100644
--- a/packages/desktop-client/src/hooks/usePayeeRuleCounts.ts
+++ b/packages/desktop-client/src/hooks/usePayeeRuleCounts.ts
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
type PayeeRuleCounts = Map<string, number>;
diff --git a/packages/desktop-client/src/hooks/usePluggyAiStatus.ts b/packages/desktop-client/src/hooks/usePluggyAiStatus.ts
index be4ecd99a7..dfe6583a25 100644
--- a/packages/desktop-client/src/hooks/usePluggyAiStatus.ts
+++ b/packages/desktop-client/src/hooks/usePluggyAiStatus.ts
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { useSyncServerStatus } from './useSyncServerStatus';
diff --git a/packages/desktop-client/src/hooks/usePreviewTransactions.ts b/packages/desktop-client/src/hooks/usePreviewTransactions.ts
index ae3a745c17..9e77056fc1 100644
--- a/packages/desktop-client/src/hooks/usePreviewTransactions.ts
+++ b/packages/desktop-client/src/hooks/usePreviewTransactions.ts
@@ -1,6 +1,6 @@
import { useEffect, useMemo, useRef, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { computeSchedulePreviewTransactions } from 'loot-core/shared/schedules';
import { ungroupTransactions } from 'loot-core/shared/transactions';
import type { IntegerAmount } from 'loot-core/shared/util';
diff --git a/packages/desktop-client/src/hooks/useScheduleEdit.ts b/packages/desktop-client/src/hooks/useScheduleEdit.ts
index df808b19c8..529027b868 100644
--- a/packages/desktop-client/src/hooks/useScheduleEdit.ts
+++ b/packages/desktop-client/src/hooks/useScheduleEdit.ts
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import { useEffect, useEffectEvent, useReducer, useState } from 'react';
-import { send, sendCatch } from 'loot-core/platform/client/fetch';
+import { send, sendCatch } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import {
diff --git a/packages/desktop-client/src/hooks/useSelected.tsx b/packages/desktop-client/src/hooks/useSelected.tsx
index aa85a952a9..c916d75c96 100644
--- a/packages/desktop-client/src/hooks/useSelected.tsx
+++ b/packages/desktop-client/src/hooks/useSelected.tsx
@@ -9,7 +9,7 @@ import React, {
} from 'react';
import type { Dispatch, ReactElement, ReactNode } from 'react';
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import * as undo from 'loot-core/platform/client/undo';
import type { UndoState } from 'loot-core/server/undo';
diff --git a/packages/desktop-client/src/hooks/useSendPlatformRequest.ts b/packages/desktop-client/src/hooks/useSendPlatformRequest.ts
index 1f27062a25..4434157281 100644
--- a/packages/desktop-client/src/hooks/useSendPlatformRequest.ts
+++ b/packages/desktop-client/src/hooks/useSendPlatformRequest.ts
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import { useEffect, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Handlers } from 'loot-core/types/handlers';
export function useSendPlatformRequest<K extends keyof Handlers>(
diff --git a/packages/desktop-client/src/hooks/useSimpleFinStatus.ts b/packages/desktop-client/src/hooks/useSimpleFinStatus.ts
index 8cfcadde70..f6310cb389 100644
--- a/packages/desktop-client/src/hooks/useSimpleFinStatus.ts
+++ b/packages/desktop-client/src/hooks/useSimpleFinStatus.ts
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { useSyncServerStatus } from './useSyncServerStatus';
diff --git a/packages/desktop-client/src/hooks/useSpreadsheet.tsx b/packages/desktop-client/src/hooks/useSpreadsheet.tsx
index 05171aa055..87f347e56f 100644
--- a/packages/desktop-client/src/hooks/useSpreadsheet.tsx
+++ b/packages/desktop-client/src/hooks/useSpreadsheet.tsx
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
import { LRUCache } from 'lru-cache';
-import { listen, send } from 'loot-core/platform/client/fetch';
+import { listen, send } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
type SpreadsheetContextValue = ReturnType<typeof makeSpreadsheet>;
diff --git a/packages/desktop-client/src/hooks/useTransactionBatchActions.ts b/packages/desktop-client/src/hooks/useTransactionBatchActions.ts
index 9df1f1a354..1ba930924c 100644
--- a/packages/desktop-client/src/hooks/useTransactionBatchActions.ts
+++ b/packages/desktop-client/src/hooks/useTransactionBatchActions.ts
@@ -1,6 +1,6 @@
import { useTranslation } from 'react-i18next';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import * as monthUtils from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import {
diff --git a/packages/desktop-client/src/hooks/useTransactions.ts b/packages/desktop-client/src/hooks/useTransactions.ts
index 9e08edbde9..4312153685 100644
--- a/packages/desktop-client/src/hooks/useTransactions.ts
+++ b/packages/desktop-client/src/hooks/useTransactions.ts
@@ -6,7 +6,7 @@ import type {
UseInfiniteQueryResult,
} from '@tanstack/react-query';
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
import type { IntegerAmount } from 'loot-core/shared/util';
import type { TransactionEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/index.tsx b/packages/desktop-client/src/index.tsx
index 9bf837fbad..c2ba6d4bbf 100644
--- a/packages/desktop-client/src/index.tsx
+++ b/packages/desktop-client/src/index.tsx
@@ -12,7 +12,7 @@ import type { NavigateFunction } from 'react-router';
import { bindActionCreators } from '@reduxjs/toolkit';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import * as accountsSlice from './accounts/accountsSlice';
diff --git a/packages/desktop-client/src/modals/modalsSlice.ts b/packages/desktop-client/src/modals/modalsSlice.ts
index 37bbc9b953..75d61ad562 100644
--- a/packages/desktop-client/src/modals/modalsSlice.ts
+++ b/packages/desktop-client/src/modals/modalsSlice.ts
@@ -1,7 +1,7 @@
import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { IntegerAmount } from 'loot-core/shared/util';
import type { File } from 'loot-core/types/file';
import type {
diff --git a/packages/desktop-client/src/payees/payeesSlice.ts b/packages/desktop-client/src/payees/payeesSlice.ts
index cd73106295..333630b9ad 100644
--- a/packages/desktop-client/src/payees/payeesSlice.ts
+++ b/packages/desktop-client/src/payees/payeesSlice.ts
@@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
import { t } from 'i18next';
import memoizeOne from 'memoize-one';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { groupById } from 'loot-core/shared/util';
import type { AccountEntity, PayeeEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/prefs/prefsSlice.ts b/packages/desktop-client/src/prefs/prefsSlice.ts
index 60c9eb1121..48b52a8a95 100644
--- a/packages/desktop-client/src/prefs/prefsSlice.ts
+++ b/packages/desktop-client/src/prefs/prefsSlice.ts
@@ -1,7 +1,7 @@
import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import { parseNumberFormat, setNumberFormat } from 'loot-core/shared/util';
import type {
GlobalPrefs,
diff --git a/packages/desktop-client/src/queries/aqlQuery.test.ts b/packages/desktop-client/src/queries/aqlQuery.test.ts
index 794c94a334..b447c19a05 100644
--- a/packages/desktop-client/src/queries/aqlQuery.test.ts
+++ b/packages/desktop-client/src/queries/aqlQuery.test.ts
@@ -1,11 +1,11 @@
-import * as fetch from 'loot-core/platform/client/fetch';
+import * as connection from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import { aqlQuery } from './aqlQuery';
describe('aqlQuery', () => {
it('runs an AQL query', async () => {
- vi.spyOn(fetch, 'send').mockImplementation((name, args) => {
+ vi.spyOn(connection, 'send').mockImplementation((name, args) => {
if (name === 'query') {
return Promise.resolve({ data: args, dependencies: [] });
}
diff --git a/packages/desktop-client/src/queries/aqlQuery.ts b/packages/desktop-client/src/queries/aqlQuery.ts
index f6593d6656..f7e8f65585 100644
--- a/packages/desktop-client/src/queries/aqlQuery.ts
+++ b/packages/desktop-client/src/queries/aqlQuery.ts
@@ -1,4 +1,4 @@
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
export async function aqlQuery(query: Query) {
diff --git a/packages/desktop-client/src/queries/liveQuery.test.ts b/packages/desktop-client/src/queries/liveQuery.test.ts
index d628c70b43..207beeb956 100644
--- a/packages/desktop-client/src/queries/liveQuery.test.ts
+++ b/packages/desktop-client/src/queries/liveQuery.test.ts
@@ -1,5 +1,5 @@
// @ts-strict-ignore
-import * as fetch from 'loot-core/platform/client/fetch';
+import * as connection from 'loot-core/platform/client/connection';
import { q } from 'loot-core/shared/query';
import { resetTracer, tracer } from 'loot-core/shared/test-helpers';
@@ -63,10 +63,10 @@ async function mockSend(name, args, { delay }) {
}
function mockServer({ send = mockSend, listen = mockListen }) {
- vi.spyOn(fetch, 'send').mockImplementation((name, args) => {
+ vi.spyOn(connection, 'send').mockImplementation((name, args) => {
return send(name, args, { delay: 0 });
});
- vi.spyOn(fetch, 'listen').mockImplementation(listen);
+ vi.spyOn(connection, 'listen').mockImplementation(listen);
}
function clearMockServer() {
diff --git a/packages/desktop-client/src/queries/liveQuery.ts b/packages/desktop-client/src/queries/liveQuery.ts
index 040c9331b2..27030be177 100644
--- a/packages/desktop-client/src/queries/liveQuery.ts
+++ b/packages/desktop-client/src/queries/liveQuery.ts
@@ -1,5 +1,5 @@
// @ts-strict-ignore
-import { listen } from 'loot-core/platform/client/fetch';
+import { listen } from 'loot-core/platform/client/connection';
import type { Query } from 'loot-core/shared/query';
import { aqlQuery } from './aqlQuery';
diff --git a/packages/desktop-client/src/queries/pagedQuery.test.ts b/packages/desktop-client/src/queries/pagedQuery.test.ts
index 7a7d7a966f..4ac57a1c2a 100644
--- a/packages/desktop-client/src/queries/pagedQuery.test.ts
+++ b/packages/desktop-client/src/queries/pagedQuery.test.ts
@@ -1,5 +1,5 @@
// @ts-strict-ignore
-import * as fetch from 'loot-core/platform/client/fetch';
+import * as connection from 'loot-core/platform/client/connection';
import { subDays } from 'loot-core/shared/months';
import { q } from 'loot-core/shared/query';
import { resetTracer, tracer } from 'loot-core/shared/test-helpers';
@@ -125,10 +125,10 @@ async function mockSend(name, args, { delay }) {
}
function mockServer({ send = mockSend, listen = mockListen }) {
- vi.spyOn(fetch, 'send').mockImplementation((name, args) => {
+ vi.spyOn(connection, 'send').mockImplementation((name, args) => {
return send(name, args, { delay: 0 });
});
- vi.spyOn(fetch, 'listen').mockImplementation(listen);
+ vi.spyOn(connection, 'listen').mockImplementation(listen);
}
function clearMockServer() {
diff --git a/packages/desktop-client/src/reports/mutations.ts b/packages/desktop-client/src/reports/mutations.ts
index b9daa27907..ff161d5343 100644
--- a/packages/desktop-client/src/reports/mutations.ts
+++ b/packages/desktop-client/src/reports/mutations.ts
@@ -4,8 +4,8 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import type { QueryClient, QueryKey } from '@tanstack/react-query';
import { v4 as uuidv4 } from 'uuid';
-import { sendCatch } from 'loot-core/platform/client/fetch';
-import type { send } from 'loot-core/platform/client/fetch';
+import { sendCatch } from 'loot-core/platform/client/connection';
+import type { send } from 'loot-core/platform/client/connection';
import { logger } from 'loot-core/platform/server/log';
import type { CustomReportEntity } from 'loot-core/types/models';
diff --git a/packages/desktop-client/src/reports/queries.ts b/packages/desktop-client/src/reports/queries.ts
index 71a8da9e90..c06f080351 100644
--- a/packages/desktop-client/src/reports/queries.ts
+++ b/packages/desktop-client/src/reports/queries.ts
@@ -1,6 +1,6 @@
import { queryOptions } from '@tanstack/react-query';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { CustomReportEntity } from 'loot-core/types/models';
export const reportQueries = {
diff --git a/packages/desktop-client/src/sync-events.ts b/packages/desktop-client/src/sync-events.ts
index 1ca3ec221a..70862a6528 100644
--- a/packages/desktop-client/src/sync-events.ts
+++ b/packages/desktop-client/src/sync-events.ts
@@ -2,7 +2,7 @@
import type { QueryClient } from '@tanstack/react-query';
import { t } from 'i18next';
-import { listen, send } from 'loot-core/platform/client/fetch';
+import { listen, send } from 'loot-core/platform/client/connection';
import { reloadAccounts } from './accounts/accountsSlice';
import { resetSync, sync } from './app/appSlice';
diff --git a/packages/desktop-client/src/tags/tagsSlice.ts b/packages/desktop-client/src/tags/tagsSlice.ts
index 0d676c1b83..ed8ff02cda 100644
--- a/packages/desktop-client/src/tags/tagsSlice.ts
+++ b/packages/desktop-client/src/tags/tagsSlice.ts
@@ -1,6 +1,6 @@
import { createSlice } from '@reduxjs/toolkit';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { TagEntity } from 'loot-core/types/models';
import { resetApp } from '@desktop-client/app/appSlice';
diff --git a/packages/desktop-client/src/undo/index.ts b/packages/desktop-client/src/undo/index.ts
index 509f59330d..cc4e70125c 100644
--- a/packages/desktop-client/src/undo/index.ts
+++ b/packages/desktop-client/src/undo/index.ts
@@ -1,4 +1,4 @@
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
function throttle(callback: () => void, wait: number) {
let waiting = false;
diff --git a/packages/desktop-client/src/users/usersSlice.ts b/packages/desktop-client/src/users/usersSlice.ts
index 5ead639bf5..db7ad9a2fa 100644
--- a/packages/desktop-client/src/users/usersSlice.ts
+++ b/packages/desktop-client/src/users/usersSlice.ts
@@ -1,7 +1,7 @@
import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
-import { send } from 'loot-core/platform/client/fetch';
+import { send } from 'loot-core/platform/client/connection';
import type { Handlers } from 'loot-core/types/handlers';
import { resetApp } from '@desktop-client/app/appSlice';
diff --git a/packages/loot-core/package.json b/packages/loot-core/package.json
index 519055bb38..8d144818e4 100644
--- a/packages/loot-core/package.json
+++ b/packages/loot-core/package.json
@@ -32,9 +32,9 @@
"./client/transfer": "./src/client/transfer.ts",
"./client/undo": "./src/client/undo.ts",
"./mocks": "./src/mocks/index.ts",
- "./platform/client/fetch": {
- "node": "./src/platform/client/fetch/index.ts",
- "default": "./src/platform/client/fetch/index.browser.ts"
+ "./platform/client/connection": {
+ "node": "./src/platform/client/connection/index.ts",
+ "default": "./src/platform/client/connection/index.browser.ts"
},
"./platform/client/undo": "./src/platform/client/undo/index.ts",
"./platform/exceptions": "./src/platform/exceptions/index.ts",
diff --git a/packages/loot-core/src/mocks/setup.ts b/packages/loot-core/src/mocks/setup.ts
index 83ed3b8f09..d60efd4025 100644
--- a/packages/loot-core/src/mocks/setup.ts
+++ b/packages/loot-core/src/mocks/setup.ts
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import * as nativeFs from 'fs';
-import * as fetchClient from '../platform/client/fetch';
+import * as fetchClient from '../platform/client/connection';
import * as sqlite from '../platform/server/sqlite';
import * as db from '../server/db';
import type * as MigrationsType from '../server/migrate/migrations';
@@ -16,7 +16,7 @@ import * as rules from '../server/transactions/transaction-rules';
import { updateVersion } from '../server/update';
import { resetTracer, tracer } from '../shared/test-helpers';
-vi.mock('../platform/client/fetch');
+vi.mock('../platform/client/connection');
vi.mock('../platform/exceptions');
vi.mock('../platform/server/asyncStorage');
vi.mock('../platform/server/connection');
diff --git a/packages/loot-core/src/platform/client/connection/README.md b/packages/loot-core/src/platform/client/connection/README.md
new file mode 100644
index 0000000000..7ea107ca12
--- /dev/null
+++ b/packages/loot-core/src/platform/client/connection/README.md
@@ -0,0 +1,3 @@
+# Client-side connection package
+
+This is the client counterpart of the `connection` server-side package (packages/loot-core/src/platform/server/connection). This contains methods to send and listen to messages to/from the browser server.
diff --git a/packages/loot-core/src/platform/client/fetch/__mocks__/index.ts b/packages/loot-core/src/platform/client/connection/__mocks__/index.ts
similarity index 100%
rename from packages/loot-core/src/platform/client/fetch/__mocks__/index.ts
rename to packages/loot-core/src/platform/client/connection/__mocks__/index.ts
diff --git a/packages/loot-core/src/platform/client/fetch/index-types.ts b/packages/loot-core/src/platform/client/connection/index-types.ts
similarity index 97%
rename from packages/loot-core/src/platform/client/fetch/index-types.ts
rename to packages/loot-core/src/platform/client/connection/index-types.ts
index 0570424085..a8f4e4a67d 100644
--- a/packages/loot-core/src/platform/client/fetch/index-types.ts
+++ b/packages/loot-core/src/platform/client/connection/index-types.ts
@@ -1,7 +1,7 @@
import type { Handlers } from '../../../types/handlers';
import type { ServerEvents } from '../../../types/server-events';
-export declare function init(worker: Worker): Promise<unknown>;
+export declare function init(): Promise<unknown>;
export type Init = typeof init;
/**
diff --git a/packages/loot-core/src/platform/client/fetch/index.browser.ts b/packages/loot-core/src/platform/client/connection/index.browser.ts
similarity index 98%
rename from packages/loot-core/src/platform/client/fetch/index.browser.ts
rename to packages/loot-core/src/platform/client/connection/index.browser.ts
index 72b0e46898..ed6c93ef24 100644
--- a/packages/loot-core/src/platform/client/fetch/index.browser.ts
+++ b/packages/loot-core/src/platform/client/connection/index.browser.ts
@@ -149,7 +149,8 @@ function connectWorker(worker, onOpen, onError) {
}
}
-export const init: T.Init = async function (worker) {
+export const init: T.Init = async function () {
+ const worker = await global.Actual.getServerSocket();
return new Promise((resolve, reject) =>
connectWorker(worker, resolve, reject),
);
diff --git a/packages/loot-core/src/platform/client/fetch/index.ts b/packages/loot-core/src/platform/client/connection/index.ts
similarity index 100%
rename from packages/loot-core/src/platform/client/fetch/index.ts
rename to packages/loot-core/src/platform/client/connection/index.ts
diff --git a/packages/loot-core/src/platform/server/connection/README.md b/packages/loot-core/src/platform/server/connection/README.md
new file mode 100644
index 0000000000..f8f04e4da1
--- /dev/null
+++ b/packages/loot-core/src/platform/server/connection/README.md
@@ -0,0 +1,3 @@
+# Server-side connection package
+
+This is the server counterpart of the `connection` client-side package (packages/loot-core/src/platform/client/connection). This contains methods to receive, reply, and push messages from/to the client web application.
diff --git a/upcoming-release-notes/6943.md b/upcoming-release-notes/6943.md
new file mode 100644
index 0000000000..dc0e50d545
--- /dev/null
+++ b/upcoming-release-notes/6943.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [joel-jeremy]
+---
+
+Rename fetch module to connection, simplifying imports and reducing confusion with native fetch.