Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .agents/handoffs/3233.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
schema_version: 1
task_id: "3233"
from: Implementer
to: GitHub
owner: GitHub
status: verifying
artifact:
- path: packages/web/src/sse/hooks/useSyncSSE.factory.ts
- path: packages/web/src/auth/providers/connection-revoked.util.ts
- path: packages/web/src/auth/providers/provider-copy.util.ts
- path: packages/web/src/booking/BookingConnectGooglePrompt.tsx
- path: packages/web/src/calendars/calendar.util.ts
- path: packages/web/src/auth/posthog/track.ts
evidence:
- command: bun run verify --strict
result: "VERDICT: PASS (test:web, type-check, lint, knip, test:a11y, test:e2e)"
- command: wc -l packages/web/src/auth/google/**/*.ts*
result: "762 (below 1500); remaining files are sign-in only"
assumptions:
- "Main's WP-08b (#3382) kept ConnectProviderChooser; this WP extends it with a prompt variant instead of adding ProviderConnectChooser."
- "PR #3384 is the superseded conflicting 08c attempt based on a different 08b."
open_risks: []
next_deadline: 2026-09-05T12:00:00Z
retry: 0
approval: human
waiting_on: null
escalation: null
---

P0 WP-08c: migrate SSE, booking, calendars and analytics off the Google connect
layer, then delete that layer.

Remaining `packages/web/src/auth/google/` files (sign-in only, keep until
milestone I):

- `google-auth-config.ts` + test
- `authorization/complete-google-authorization.ts`
- `authorization/google-authorization.{constants,storage,util}` + tests
- `authorization/useStartGoogleAuthorization.ts` + `.impl.ts`
- `authorization/google-authorization.test.ts`
4 changes: 1 addition & 3 deletions packages/web/src/__tests__/helpers/web-test-seams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ import {
} from "@web/auth/google/authorization/useStartGoogleAuthorization";
import {
resetGoogleAvailabilityForTests,
setGoogleAvailabilityForTests,
} from "@web/auth/google/hooks/useIsGoogleAvailable/useIsGoogleAvailable";
import {
resetProviderAvailabilityForTests,
setGoogleAvailabilityForTests,
setProviderAvailabilityForTests,
} from "@web/auth/providers/useIsProviderAvailable";
import { resetEmbeddedCheckoutForTests } from "@web/billing/embedded-checkout/embedded-checkout.seam";
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/app.bootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { createRoot } from "react-dom/client";
import "react-toastify/dist/ReactToastify.css";
import "./common/styles/toastify-theme.css";
import { sessionInit } from "@web/auth/compass/session/SessionProvider";
import { configureGoogleRevocationApiHandler } from "@web/auth/google/util/google-revocation-api.config";
import {
readConnectStatus,
refreshUserMetadataAfterConnect,
showConnectStatusToast,
} from "@web/auth/providers/connect-status.util";
import { configureGoogleRevocationApiHandler } from "@web/auth/providers/revocation-api.config";
import {
initializeDatabaseWithErrorHandling,
showDbInitErrorToast,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
markUserAsAuthenticated,
} from "@web/auth/compass/state/auth.state.util";
import { refreshUserMetadata } from "@web/auth/compass/user/util/user-metadata.util";
import { syncPendingLocalEvents } from "@web/auth/google/util/google.auth.util";
import { syncPendingLocalEvents } from "@web/auth/providers/connection-revoked.util";
import { eventQueryKeys } from "@web/events/queries/event.query.keys";
import { refreshEventRepositorySource } from "@web/events/repositories/event.repository.source.store";
import { createUseCompleteAuthentication } from "./useCompleteAuthentication.factory";
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/auth/compass/session/SessionProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
getLastKnownEmail,
markUserAsAuthenticated,
} from "@web/auth/compass/state/auth.state.util";
import { clearGoogleSyncIndicatorOverride } from "@web/auth/providers/sync.indicator.state";
import { userMetadataActions } from "@web/auth/state/user-metadata.store";
import { ENV_WEB } from "@web/common/constants/env.constants";
import { ROOT_ROUTES } from "@web/common/constants/routes";
import { createExternalStore } from "@web/common/utils/external-store.util";
import { refreshEventRepositorySource } from "@web/events/repositories/event.repository.source.store";
import * as sse from "@web/sse/provider/SSEProvider";
import { clearGoogleSyncIndicatorOverride } from "../../google/state/google.sync.state";
import { refreshUserMetadata } from "../user/util/user-metadata.util";
import { SessionContext } from "./session.context";

Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/auth/compass/session/logout.teardown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const mockDraftActionsDiscard = mock();
// and only intercept what this file asserts on while it runs - the flag flips
// back to the real implementations in afterAll, because many later suites
// exercise these functions for real (draftActions.discard closes event forms,
// clearGoogleSyncIndicatorOverride drives useGcalSSE, and the source store's
// clearGoogleSyncIndicatorOverride drives useSyncSSE, and the source store's
// own tests call refreshEventRepositorySource).
const actualRepositorySource = {
...(await import("@web/events/repositories/event.repository.source.store")),
Expand All @@ -32,7 +32,7 @@ const actualUserMetadata = {
};
const actualSseClient = { ...(await import("@web/sse/client/sse.client")) };
const actualSyncState = {
...(await import("@web/auth/google/state/google.sync.state")),
...(await import("@web/auth/providers/sync.indicator.state")),
};
const actualDraftStore = {
...(await import("@web/events/stores/draft.store")),
Expand Down Expand Up @@ -62,7 +62,7 @@ mock.module("@web/auth/state/user-metadata.store", () => ({
},
}));

mock.module("@web/auth/google/state/google.sync.state", () => ({
mock.module("@web/auth/providers/sync.indicator.state", () => ({
...actualSyncState,
clearGoogleSyncIndicatorOverride: (...args: unknown[]) =>
isTeardownMocked
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/auth/compass/session/logout.teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { queryClient } from "@web/api/query-client";
import { clearGoogleSyncIndicatorOverride } from "@web/auth/google/state/google.sync.state";
import { clearGoogleSyncIndicatorOverride } from "@web/auth/providers/sync.indicator.state";
import { userMetadataActions } from "@web/auth/state/user-metadata.store";
import { calendarQueryKeys } from "@web/calendars/calendar.query";
import { eventQueryKeys } from "@web/events/queries/event.query.keys";
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/auth/compass/state/auth.state.util.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { z } from "zod/v4";
import { clearAllGoogleReconnectRequired } from "@web/auth/providers/reconnect.state";
import { STORAGE_KEYS } from "@web/common/constants/storage.constants";
import { persistentBrowserStore } from "@web/common/storage/browser-key-value.store";
import { subscribeToStorageKey } from "@web/common/utils/external-store.util";
import { clearAllGoogleReconnectRequired } from "../../google/state/google.reconnect.state";

export const AuthStateSchema = z.object({
hasAuthenticated: z.boolean().default(false),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type UserMetadata } from "@core/types/user.types";
import { createTestToastPort } from "@web/__tests__/helpers/web-test-seams";
import { BaseApi } from "@web/api/base/base.api";
import { resetGoogleReconnectRequiredForTests } from "@web/auth/google/state/google.reconnect.state";
import { resetGoogleReconnectRequiredForTests } from "@web/auth/providers/reconnect.state";
import { GOOGLE_DELAYED_TOAST_ID } from "@web/common/constants/toast.constants";
import { registerToastPort } from "@web/common/utils/toast/toast.port";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getGoogleReconnectRequiredAccountEmails,
hasGoogleReconnectRequired,
syncReconnectRequiredFromConnections,
} from "@web/auth/google/state/google.reconnect.state";
} from "@web/auth/providers/reconnect.state";
import {
findPrimaryGoogleSyncConnectionFromMetadata,
userMetadataActions,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const useStartGoogleAuthorizationImpl = ({
// PostHog loses the session at the redirect; this marks "left for
// Google" so abandoned round trips are distinguishable from silent
// failures on return.
track("google_oauth_redirect_started", { intent });
track("oauth_redirect_started", { provider: "google", intent });
return startGoogleAuthorization();
}, [intent, onStart, startGoogleAuthorization, state]),
};
Expand Down

This file was deleted.

This file was deleted.

Loading