Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
c19c893
refactor(account): make hosts the single source of auth copy
MaanilVerma Sep 14, 2026
e211cd3
fix(locales): drop account-existence wording from email-already-in-use
MaanilVerma Sep 14, 2026
64ece9e
test(auth): guard cloud auth copy against account enumeration
MaanilVerma Sep 14, 2026
3aa6c3c
test(auth): address review nits on auth copy resolution
MaanilVerma Sep 14, 2026
36c5790
test(website): assert the collapsed invalid-credential line on user-n…
MaanilVerma Sep 15, 2026
c66a653
fix(website): drop the unrenderable user-not-found/wrong-password copy
MaanilVerma Sep 15, 2026
9348238
test(website): broaden the sign-in enumeration oracle to match the cl…
MaanilVerma Sep 15, 2026
b742c75
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 15, 2026
7184764
fix(locales): drop the unrenderable user-not-found/wrong-password copy
MaanilVerma Sep 15, 2026
d0e3c13
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 15, 2026
3633eb7
test(website): use the i18n generic-error copy after the main merge
MaanilVerma Sep 15, 2026
cea548a
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 15, 2026
61b4451
fix(workspace): type the session error key against the locale shape
MaanilVerma Sep 15, 2026
b7a3541
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 15, 2026
885faf4
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 15, 2026
e68e3f0
Merge remote-tracking branch 'origin/main' into maanil/fe-2188-locali…
MaanilVerma Sep 15, 2026
4db1dbe
Merge remote-tracking branch 'origin/main' into maanil/fe-2191-decomp…
MaanilVerma Sep 16, 2026
d69670b
refactor(account): add pure session state transition and mint arbitra…
MaanilVerma Sep 16, 2026
7a16e1f
refactor(account): route every session commit through one transition
MaanilVerma Sep 16, 2026
6c9c0a5
refactor(account): import AccountUser from sessionContracts in identity
MaanilVerma Sep 16, 2026
d5e9fc3
refactor(account): carry commit payloads in session events and effects
MaanilVerma Sep 16, 2026
4878540
refactor(account): extract credential cache and mint coordinator from…
MaanilVerma Sep 16, 2026
3ccca0d
refactor(account): keep credential freshness policy with the cache
MaanilVerma Sep 16, 2026
d18c716
Merge remote-tracking branch 'origin/main' into maanil/fe-2196-c2-con…
MaanilVerma Sep 16, 2026
ce6d000
feat(account): construct the session client with identity and add dis…
MaanilVerma Sep 16, 2026
c265fdb
fix(account): harden the construct-with-identity tests and neutralize…
MaanilVerma Sep 16, 2026
4516673
refactor(cloud): construct the session client with identity in worksp…
MaanilVerma Sep 16, 2026
75711dc
refactor(cloud): review fixes for construct-with-identity in workspac…
MaanilVerma Sep 16, 2026
821bdf6
refactor(account): route the expiry commit through the single commit …
MaanilVerma Sep 16, 2026
c31f4ac
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 16, 2026
75e3c28
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 16, 2026
f7e2e23
Merge remote-tracking branch 'origin/main' into maanil/fe-2191-decomp…
MaanilVerma Sep 16, 2026
e7153ec
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 16, 2026
7459488
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 16, 2026
9874cfe
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 16, 2026
651e277
Merge branch 'maanil/fe-2188-localization-sso' into maanil/fe-2191-de…
MaanilVerma Sep 16, 2026
59b7573
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 16, 2026
1b84482
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 16, 2026
71e38b3
refactor(account): split the session transition and mint arbitration …
MaanilVerma Sep 16, 2026
0f96221
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 16, 2026
5f7ad49
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 16, 2026
612a1bb
fix(account): tighten the popup mint to exactly one identity event
MaanilVerma Sep 16, 2026
44bbc19
perf(account): read stored credentials only when the in-memory one is…
MaanilVerma Sep 16, 2026
84a1ca2
fix(account): detach an identity subscription disposed during its fir…
MaanilVerma Sep 16, 2026
aeb36fc
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 16, 2026
6699d65
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 16, 2026
23c5bb6
test(auth): share the enumeration oracle and cover the cancelled seco…
MaanilVerma Sep 16, 2026
df8ea1d
Merge branch 'main' into maanil/fe-2188-localization-sso
MaanilVerma Sep 16, 2026
82e272e
Merge remote-tracking branch 'origin/maanil/fe-2188-localization-sso'…
MaanilVerma Sep 16, 2026
65fa927
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 16, 2026
eb6dd94
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 16, 2026
448c4b9
Merge remote-tracking branch 'origin/main' into maanil/fe-2188-locali…
MaanilVerma Sep 17, 2026
52054e1
Merge branch 'maanil/fe-2188-localization-sso' into maanil/fe-2191-de…
MaanilVerma Sep 17, 2026
838ae89
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
d179a6c
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
386d96d
Merge remote-tracking branch 'origin/main' into maanil/fe-2188-locali…
MaanilVerma Sep 17, 2026
1b89a09
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
ffbec33
Merge branch 'maanil/fe-2188-localization-sso' into maanil/fe-2191-de…
MaanilVerma Sep 17, 2026
ea2ac9a
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
006f110
test(account): name the post-dispose explicit-user mint for what it does
MaanilVerma Sep 17, 2026
df6ffd7
refactor(account): name the mint guards by verdict and split the type…
MaanilVerma Sep 17, 2026
19ae957
test(account): take the identity suite's fakes from the shared fixture
MaanilVerma Sep 17, 2026
d48db49
test(account): share the session test fakes from one fixture module
MaanilVerma Sep 17, 2026
c5801ad
test(cloud): model the Firebase first delivery one way and pin store …
MaanilVerma Sep 17, 2026
016f718
docs(cloud): name the construction-order dependency behind the identi…
MaanilVerma Sep 17, 2026
482ba49
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
7d1d4c7
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
7af0afe
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
9826d1b
Merge remote-tracking branch 'origin/main' into maanil/fe-2188-locali…
MaanilVerma Sep 17, 2026
f8e97d4
Merge branch 'maanil/fe-2188-localization-sso' into maanil/fe-2191-de…
MaanilVerma Sep 17, 2026
4d98540
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
ba5c637
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
feaeccc
test(account): split the client builder out of the data fixture and d…
MaanilVerma Sep 17, 2026
01a3b78
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
112bec2
test(account): import the scheduler buffer default instead of copying it
MaanilVerma Sep 17, 2026
b321250
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
f32024e
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
4fbdc9b
fix(account): drop a session subscriber whose first replay throws
MaanilVerma Sep 17, 2026
94b1495
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
6b17307
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
5b8b504
test(cloud): guard the replay port, export the settle ceiling, and ex…
MaanilVerma Sep 17, 2026
7614f52
Merge remote-tracking branch 'origin/main' into maanil/fe-2191-decomp…
MaanilVerma Sep 17, 2026
4fa9efd
Merge branch 'maanil/fe-2191-decompose-session' into maanil/fe-2196-c…
MaanilVerma Sep 17, 2026
cb01c88
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
e8b0522
test(cloud): stub firebase and vuefire in the billing subscription-ra…
MaanilVerma Sep 17, 2026
2949c2e
Merge remote-tracking branch 'origin/main' into maanil/fe-2196-c2-con…
MaanilVerma Sep 17, 2026
4eea04e
Merge branch 'maanil/fe-2196-c2-construct-with-identity' into maanil/…
MaanilVerma Sep 17, 2026
d145c57
Merge branch 'main' into maanil/fe-2196-c3-store-construct-with-identity
MaanilVerma Sep 17, 2026
5e57606
Merge remote-tracking branch 'origin/main' into maanil/fe-2196-c3-sto…
MaanilVerma Sep 18, 2026
549b82b
fix(cloud): fail closed when a rollback catches a unified mint parked…
MaanilVerma Sep 18, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Date: 2026-09-09

Proposed

Amended 2026-09-16: rules 1 and 4 follow the session client taking identity at
construction (FE-2196).

## Context

The cloud app holds two consumers of Firebase identity:
Expand All @@ -28,8 +31,9 @@ is not a contract to build on.

1. Identity reaches the session client through the package entry bound to
the app's own `Auth` instance: `authStore` creates
`createFirebaseIdentity({ auth })` and `workspaceAuthStore` attaches it
as the client's `IdentityPort`. No hand-rolled port exists in `src/`.
`createFirebaseIdentity({ auth })` and `workspaceAuthStore` passes it to
`createSessionClient` at construction. No hand-rolled port exists in
`src/`.
2. The Pinia `authStore` is a projection for app-wide side effects. It is
not an identity authority for the session client and pushes nothing
into it.
Expand All @@ -44,10 +48,27 @@ is not a contract to build on.
port's user is what mints. The wait is bounded, so a silent port fails
the mint closed instead of hanging the auth gate. Mints stay
host-driven (`autoMint: false`), so telemetry and coalescing are
unchanged.
4. `syncUnifiedIdentity` is gone; the flag rule stays: with
`unified_cloud_auth` off the port is never attached and no state is
held.
unchanged. The two stores construct each other (`workspaceAuthStore`
reads `useAuthStore().identity` in its setup, `authStore`'s listener
calls `useWorkspaceAuthStore()`), which holds only because the SDK
delivers a new observer's first emission asynchronously, after
persistence resolves; a synchronous identity source in its place would
re-enter a half-built store: built workspace-first it throws a boot-time
`TypeError` from `authStore`'s listener against the half-assigned store,
built auth-first it leaves the client unsubscribed and every mint waiting
its ceiling. The "store construction order" test in `authStore.test.ts`
pins the working microtask order.
4. `syncUnifiedIdentity` is gone, and the flag gates minting, not
subscription: identity is bound to the session client for the store's
lifetime. With `unified_cloud_auth` off the port stays subscribed but
inert. The store drives every mint explicitly (`autoMint: false`), so an
identity event mints nothing, and `clearUnifiedContext()` invalidates the
credential and stops the scheduler and cross-tab lease. A mint already
parked on `unifiedUser()` when the flag flips is caught by the flag-gated
helpers re-checking the flag after that await, so it commits nothing
either: no unified token, network call or timer exists. The residue is the
snapshot's user and a `minting`/`pending` phase that no flag-off consumer
reads.
5. Nothing in `src/` may initialize a second Firebase app through
`createFirebaseIdentity({ options })` while the app runs on vuefire; a
second auth instance diverges the session. Package-initialized Firebase
Expand Down
5 changes: 5 additions & 0 deletions src/platform/auth/unified/remintRetry.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useWorkspaceAuthStore } from '@/platform/workspace/stores/workspaceAuthStore'
import { stubAccountIdentityPort } from '@/utils/__tests__/stubAccountIdentityPort'
import type { AxiosAdapter } from 'axios'
import axios, { AxiosError } from 'axios'
import { beforeEach, describe, expect, it, vi } from 'vitest'
Expand All @@ -17,6 +18,9 @@ const { mockRemint, flagState } = vi.hoisted(() => ({

vi.mock(import('@/platform/telemetry'))

vi.mock(import('vuefire'), () => ({ useFirebaseAuth: vi.fn() }))
vi.mock(import('firebase/auth'))

vi.mock<unknown>(import('@/composables/useFeatureFlags'), () => ({
useFeatureFlags: () => ({
flags: {
Expand All @@ -34,6 +38,7 @@ vi.mock(import('@/platform/distribution/types'), () => ({
}))

beforeEach(() => {
stubAccountIdentityPort()
vi.mocked(useWorkspaceAuthStore().remintUnifiedOnce).mockImplementation(
mockRemint
)
Expand Down
3 changes: 3 additions & 0 deletions src/platform/workspace/auth/WorkspaceAuthGate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
remoteConfigState
} from '@/platform/remoteConfig/remoteConfig'

import { stubAccountIdentityPort } from '@/utils/__tests__/stubAccountIdentityPort'

import WorkspaceAuthGate from './WorkspaceAuthGate.vue'

vi.mock(import('firebase/auth'), { spy: true })
Expand All @@ -28,6 +30,7 @@ beforeEach(() => {
vi.mocked(setPersistence).mockResolvedValue(undefined)
vi.mocked(onAuthStateChanged).mockImplementation(vi.fn())
vi.mocked(onIdTokenChanged).mockImplementation(vi.fn())
stubAccountIdentityPort()
})

async function flushPromises() {
Expand Down
5 changes: 5 additions & 0 deletions src/platform/workspace/billing/sdk/billingSdkStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useToastStore } from '@/platform/updates/common/toastStore'
import { WorkspaceApiError } from '@/platform/workspace/api/workspaceApi'
import { workspaceApiUrl } from '@/platform/workspace/api/workspaceApiUrl'
import { useWorkspaceAuthStore } from '@/platform/workspace/stores/workspaceAuthStore'
import { stubAccountIdentityPort } from '@/utils/__tests__/stubAccountIdentityPort'
import { useDialogStore } from '@/stores/dialogStore'

import { useBillingSdkStore } from './billingSdkStore'
Expand Down Expand Up @@ -78,6 +79,9 @@ vi.mock<unknown>(import('@/composables/useFeatureFlags'), () => ({

vi.mock(import('@/platform/distribution/types'), () => ({ isCloud: true }))

vi.mock(import('vuefire'), () => ({ useFirebaseAuth: vi.fn() }))
vi.mock(import('firebase/auth'))

const mockLoadStripe = vi.hoisted(() => vi.fn())
vi.mock<unknown>(import('@stripe/stripe-js/pure'), () => ({
loadStripe: mockLoadStripe
Expand All @@ -87,6 +91,7 @@ let harness: ReturnType<typeof fakeBillingSdk>
let options: BillingSdkOptions

beforeEach(() => {
stubAccountIdentityPort()
flagState.embeddedCheckoutEnabled = false
flagState.hostedBillingDestination = 'stripe'
harness = fakeBillingSdk()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import type { BillingSdk } from '@/platform/workspace/billing/sdk/createBillingS
import { billingOperation } from '@/platform/workspace/composables/billingOperationTestUtils'
import { useTopupOperation } from '@/platform/workspace/composables/useTopupOperation'
import { useBillingOperationStore } from '@/platform/workspace/stores/billingOperationStore'
import { stubAccountIdentityPort } from '@/utils/__tests__/stubAccountIdentityPort'

vi.mock(import('vuefire'), () => ({ useFirebaseAuth: vi.fn() }))
vi.mock(import('firebase/auth'))

const flagState = vi.hoisted(() => ({
billingSdkTopupEnabled: false,
Expand Down Expand Up @@ -58,6 +62,7 @@ vi.mock(import('@/platform/workspace/billing/sdk/createBillingSdk'), () => ({
let harness: ReturnType<typeof fakeBillingSdk>

beforeEach(() => {
stubAccountIdentityPort()
harness = fakeBillingSdk()
mockCreateBillingSdk.mockReturnValue(harness.sdk)
flagState.unifiedCloudAuthEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { fakeBillingSdk } from '@/platform/workspace/billing/sdk/billingSdkTestU
import type { BillingSdk } from '@/platform/workspace/billing/sdk/createBillingSdk'
import { useWorkspaceBilling } from '@/platform/workspace/composables/useWorkspaceBilling'
import { useBillingOperationStore } from '@/platform/workspace/stores/billingOperationStore'
import { stubAccountIdentityPort } from '@/utils/__tests__/stubAccountIdentityPort'

vi.mock(import('vuefire'), () => ({ useFirebaseAuth: vi.fn() }))
vi.mock(import('firebase/auth'))
Comment thread
MaanilVerma marked this conversation as resolved.
Resolved

const flagState = vi.hoisted(() => ({
billingSdkTopupEnabled: false,
Expand Down Expand Up @@ -118,6 +122,7 @@ function setupBilling() {
}

beforeEach(() => {
stubAccountIdentityPort()
harness = fakeBillingSdk()
mockCreateBillingSdk.mockReturnValue(harness.sdk)
flagState.billingSdkSubscriptionEnabled = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { effectScope } from 'vue'

vi.mock(import('firebase/auth'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Minor (tests)

What: src/platform/workspace/composables/useWorkspaceBilling.subscriptionRail.test.ts:4-7 automocks firebase/auth and returns {} from useFirebaseAuth, with no stubAccountIdentityPort() in beforeEach (:146), where the directory's three siblings (useTopupOperation.test.ts:16-17,65, useWorkspaceBilling.sdk.test.ts:12-13,88, billingSdkStore.test.ts:82-83,94) mock useFirebaseAuth to undefined and spy the port first.

Why this is an issue: src/stores/authStore.ts:125 hands the identity that {} as its Auth, so onUserChanged (packages/account-core/src/firebase/index.ts:141) returns the automocked onAuthStateChanged's undefined, which the session client stores as its unsubscribe (packages/account-core/src/core/session.ts:513) and would call on detach (:509, :520); latent only because the suite never disposes.

Proposed Fix: use the siblings' trio (useFirebaseAuth: vi.fn(), the automock, stubAccountIdentityPort() first in beforeEach); the same block in #17834 already carries that rung's harness shape and the next merge upward conflicts here, so keep #17834's version there.

vi.mock<unknown>(import('vuefire'), () => ({
useFirebaseAuth: vi.fn(() => ({}))
}))

import type { BillingTelemetryEvent } from '@/platform/telemetry/types'
import type {
BillingStatusResponse,
Expand Down
5 changes: 5 additions & 0 deletions src/platform/workspace/stores/teamWorkspaceStore.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { computed } from 'vue'
import { useWorkspaceAuthStore } from '@/platform/workspace/stores/workspaceAuthStore'
import { stubAccountIdentityPort } from '@/utils/__tests__/stubAccountIdentityPort'
import { beforeEach, describe, expect, it, vi } from 'vitest'

import { useCurrentUser } from '@/composables/auth/useCurrentUser'
Expand All @@ -11,6 +12,9 @@ const mockDistributionTypes = vi.hoisted(() => ({ isCloud: true }))

vi.mock(import('@/platform/distribution/types'), () => mockDistributionTypes)

vi.mock(import('vuefire'), () => ({ useFirebaseAuth: vi.fn() }))
vi.mock(import('firebase/auth'))

const mockClearWorkflowRestoreState = vi.hoisted(() => vi.fn())
const mockPrepareWorkflowWorkspaceTransition = vi.hoisted(() => vi.fn())

Expand Down Expand Up @@ -134,6 +138,7 @@ function expectCleanupBeforeContextAndReload(): void {
}

beforeEach(() => {
stubAccountIdentityPort()
useCurrentUser().userEmail = computed(() => null)

Object.assign(useWorkspaceAuthStore(), {
Expand Down
Loading
Loading