diff --git a/configs/Firebase-config.ts b/configs/Firebase-config.ts index a7d97cc0..a5d32901 100644 --- a/configs/Firebase-config.ts +++ b/configs/Firebase-config.ts @@ -1,7 +1,9 @@ import { initializeApp, getApps, FirebaseApp } from "firebase/app"; -import { - getAuth, - Auth, +import { + getAuth, + initializeAuth, + inMemoryPersistence, + Auth, onIdTokenChanged as firebaseOnIdTokenChanged, onAuthStateChanged as firebaseOnAuthStateChanged, signInWithPopup as firebaseSignInWithPopup, @@ -74,8 +76,10 @@ function initializeMockFirebase() { initializeApp({ apiKey: "fake-key", authDomain: "fake.firebaseapp.com", projectId: "fake-project" }) : getApps()[0]; - // Get the real auth instance - auth = getAuth(firebase_app); + // Use inMemoryPersistence so Firebase never reads/writes auth state to IndexedDB. + // Without this, Firebase tries to restore a previously-persisted mock user from storage + // and calls _stopProactiveRefresh() on the plain JSON object, which fails. + auth = initializeAuth(firebase_app, { persistence: inMemoryPersistence }); db = getFirestore(firebase_app); // Create a mock user diff --git a/lib/utils.ts b/lib/utils.ts index cf380a09..94260b6d 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -238,6 +238,9 @@ export const generateMockUser = () => { displayName: "Local Dev User", emailVerified: true, }), + // Internal Firebase SDK methods required when setting auth.currentUser directly + _stopProactiveRefresh: () => {}, + _startProactiveRefresh: () => {}, }; }; diff --git a/services/BranchAndRepositoryService.ts b/services/BranchAndRepositoryService.ts index e38e1d78..574fedc7 100644 --- a/services/BranchAndRepositoryService.ts +++ b/services/BranchAndRepositoryService.ts @@ -298,8 +298,8 @@ export default class BranchAndRepositoryService { } const response = await axios.post( - `${baseUrl}/api/v1/check-status`, - payload, + `${baseUrl}/api/v1/parsing-status`, + { repo_name: repoName, branch_name: branchName, filters }, { headers } ); return response.data;