Skip to content
Open
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
14 changes: 9 additions & 5 deletions configs/Firebase-config.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {},
};
};

Expand Down
4 changes: 2 additions & 2 deletions services/BranchAndRepositoryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down