@umituz/react-native-firebase 1.13.96 → 1.13.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-firebase",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.98",
|
|
4
4
|
"description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -50,20 +50,31 @@ export const useFirebaseAuthStore = createStore<AuthState, AuthActions>({
|
|
|
50
50
|
setupInProgress = true;
|
|
51
51
|
set({ listenerSetup: true });
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
try {
|
|
54
|
+
unsubscribe = onAuthStateChanged(auth, (currentUser: User | null) => {
|
|
55
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
56
|
+
console.log(
|
|
57
|
+
"[FirebaseAuthStore] Auth state changed:",
|
|
58
|
+
currentUser?.uid || "null"
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
set({
|
|
62
|
+
user: currentUser,
|
|
63
|
+
loading: false,
|
|
64
|
+
initialized: true,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Listener setup complete - keep mutex locked until cleanup
|
|
69
|
+
// (setupInProgress remains true to indicate active listener)
|
|
70
|
+
} catch (error) {
|
|
71
|
+
// On error, release the mutex so retry is possible
|
|
72
|
+
setupInProgress = false;
|
|
73
|
+
set({ listenerSetup: false });
|
|
54
74
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
55
|
-
|
|
56
|
-
console.log(
|
|
57
|
-
"[FirebaseAuthStore] Auth state changed:",
|
|
58
|
-
currentUser?.uid || "null"
|
|
59
|
-
);
|
|
75
|
+
console.error("[FirebaseAuthStore] Failed to setup listener:", error);
|
|
60
76
|
}
|
|
61
|
-
|
|
62
|
-
user: currentUser,
|
|
63
|
-
loading: false,
|
|
64
|
-
initialized: true,
|
|
65
|
-
});
|
|
66
|
-
});
|
|
77
|
+
}
|
|
67
78
|
},
|
|
68
79
|
|
|
69
80
|
cleanup: () => {
|
|
@@ -34,7 +34,13 @@ export class QueryDeduplicationMiddleware {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
this.cleanupTimer = setInterval(() => {
|
|
37
|
-
|
|
37
|
+
try {
|
|
38
|
+
this.cleanupExpiredQueries();
|
|
39
|
+
} catch {
|
|
40
|
+
// Silently handle cleanup errors to prevent timer from causing issues
|
|
41
|
+
// Clear all queries if cleanup fails to prevent memory leak
|
|
42
|
+
this.pendingQueries.clear();
|
|
43
|
+
}
|
|
38
44
|
}, this.CLEANUP_INTERVAL_MS);
|
|
39
45
|
}
|
|
40
46
|
|