Skip to content

Commit 17d935e

Browse files
committed
Revert "fix(org): fail mutations fast offline so a pending dialog can be cancelled"
This reverts commit 878abc5.
1 parent e338d51 commit 17d935e

4 files changed

Lines changed: 1 addition & 96 deletions

File tree

‎apps/sim/app/_shell/providers/get-query-client.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ export function makeQueryClient() {
2929
},
3030
mutations: {
3131
retry: false,
32-
/**
33-
* The default pauses a mutation started offline until reconnect. Nothing here persists or
34-
* shows that queue: the caller just waits, holding a pending dialog open, and the action
35-
* then runs long after the person gave up on it. Failing fast lets them see it and decide.
36-
*/
37-
networkMode: 'always',
3832
},
3933
},
4034
})

‎apps/sim/ee/data-retention/hooks/data-retention.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ export function useOrganizationRetention(orgId: string | undefined) {
3737
queryFn: ({ signal }) => fetchDataRetention(orgId as string, signal),
3838
enabled: Boolean(orgId),
3939
staleTime: DATA_RETENTION_STALE_TIME,
40-
// A save re-reads this first: offline, that read must fail rather than wait and write on reconnect.
41-
networkMode: 'always',
4240
})
4341
}
4442

‎apps/sim/platform/app/(shell)/settings/_components/sections/data-retention/data-retention-section.round-trip.test.tsx‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from '@sim/testing/mocks/api-client-request.mock'
99
import { stubResizeObserver } from '@sim/testing/mocks/browser-apis.mock'
1010
import { emcnMock, emcnMockFns } from '@sim/testing/mocks/emcn.mock'
11-
import { onlineManager, QueryClient, QueryClientProvider } from '@tanstack/react-query'
11+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
1212
import { createRoot, type Root } from 'react-dom/client'
1313
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1414
import {
@@ -161,7 +161,6 @@ describe('DataRetentionSection across saves', () => {
161161
})
162162

163163
afterEach(() => {
164-
onlineManager.setOnline(true)
165164
act(() => root.unmount())
166165
container.remove()
167166
queryClient.clear()
@@ -233,18 +232,6 @@ describe('DataRetentionSection across saves', () => {
233232
)
234233
})
235234

236-
it('stops at once while offline instead of waiting to write on reconnect', async () => {
237-
await click('Organization')
238-
await click('keep logs 7 days')
239-
onlineManager.setOnline(false)
240-
await failNextReads(() => click('Save'))
241-
242-
expect(emcnMockFns.mockToast.error).toHaveBeenCalledWith(
243-
'Could not confirm the latest retention settings. Nothing was saved.'
244-
)
245-
expect(server.writes).toEqual([])
246-
})
247-
248235
it('removes nothing over the document from before the failure', async () => {
249236
await click('Organization')
250237
await failNextReads(() => click('Remove'))

‎apps/sim/platform/design-system/components/modal/confirm-dialog.test.tsx‎

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)