Skip to content

Commit 4f370ef

Browse files
committed
fix(people): keep the publish refresh on cold status reads and fail the SCIM status read from load
1 parent fd71904 commit 4f370ef

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎apps/sim/hooks/queries/people-sync.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function isDirectorySyncAccessError(error: unknown) {
3737

3838
function refreshPublishedPeople(client: QueryClient, organizationId: string, result: SyncResult) {
3939
const previous = client.getQueryData<SyncResult>(syncKeys.organization(organizationId))
40-
if (previous && (previous.sync?.lastSuccessAt ?? null) !== (result.sync?.lastSuccessAt ?? null)) {
40+
if ((previous?.sync?.lastSuccessAt ?? null) !== (result.sync?.lastSuccessAt ?? null)) {
4141
return client.invalidateQueries({ queryKey: peopleKeys.organization(organizationId) })
4242
}
4343
}

‎apps/sim/scripts/test-scim-e2e.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,13 @@ async function run() {
535535
.addCookies([
536536
{ name: 'better-auth.session_token', value: primary.cookie, url: baseUrl.origin },
537537
])
538-
await page.goto(
539-
new URL(`/o/${primary.orgId}/people?focus=${aliceMemberId}`, baseUrl).href
540-
)
541538
const statusUrl = new URL(syncPath, baseUrl).href
542539
await page.route(statusUrl, (route) =>
543540
route.fulfill({ status: 503, json: { error: 'Unavailable' } })
544541
)
542+
await page.goto(
543+
new URL(`/o/${primary.orgId}/people?focus=${aliceMemberId}`, baseUrl).href
544+
)
545545
const openSync = page.getByRole('button', { name: 'Directory sync', exact: true })
546546
await openSync.click()
547547
await page.getByRole('heading', { name: 'Directory sync', level: 1 }).waitFor()

0 commit comments

Comments
 (0)