@umituz/react-native-firebase 2.4.97 → 2.5.1

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.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/src/domains/auth/domain/value-objects/FirebaseAuthConfig.ts +1 -1
  3. package/src/domains/auth/infrastructure/config/initializers/FirebaseAuthInitializer.ts +5 -41
  4. package/src/domains/firestore/index.ts +0 -58
  5. package/src/domains/firestore/infrastructure/config/initializers/FirebaseFirestoreInitializer.ts +4 -255
  6. package/src/domains/firestore/infrastructure/repositories/BasePaginatedRepository.ts +1 -7
  7. package/src/domains/firestore/infrastructure/repositories/BaseQueryRepository.ts +8 -34
  8. package/src/domains/firestore/infrastructure/repositories/BaseRepository.ts +9 -48
  9. package/src/domains/firestore/presentation/hooks/index.ts +0 -10
  10. package/src/index.ts +1 -1
  11. package/src/shared/infrastructure/config/clients/FirebaseClientSingleton.ts +1 -1
  12. package/src/shared/infrastructure/config/services/FirebaseInitializationService.ts +1 -1
  13. package/src/shared/infrastructure/config/state/FirebaseClientState.ts +1 -1
  14. package/src/domains/firestore/domain/constants/QuotaLimits.ts +0 -101
  15. package/src/domains/firestore/domain/entities/QuotaMetrics.ts +0 -26
  16. package/src/domains/firestore/domain/entities/RequestLog.ts +0 -28
  17. package/src/domains/firestore/domain/services/QuotaCalculator.ts +0 -71
  18. package/src/domains/firestore/infrastructure/middleware/QueryDeduplicationMiddleware.ts +0 -312
  19. package/src/domains/firestore/infrastructure/middleware/QuotaTrackingMiddleware.ts +0 -95
  20. package/src/domains/firestore/infrastructure/services/RequestLoggerService.ts +0 -165
  21. package/src/domains/firestore/presentation/hooks/useSmartFirestoreSnapshot.ts +0 -361
  22. package/src/domains/firestore/presentation/query-keys/createFirestoreKeys.ts +0 -32
  23. package/src/domains/firestore/presentation/query-keys/index.ts +0 -1
  24. package/src/domains/firestore/utils/deduplication/pending-query-manager.util.ts +0 -119
  25. package/src/domains/firestore/utils/deduplication/query-key-generator.util.ts +0 -34
  26. package/src/domains/firestore/utils/deduplication/timer-manager.util.ts +0 -83
  27. package/src/shared/infrastructure/config/initializers/FirebaseAppInitializer.ts +0 -9
@@ -1,83 +0,0 @@
1
- /**
2
- * Timer Manager Utility
3
- * Manages cleanup timers for deduplication middleware
4
- */
5
-
6
- interface TimerManagerOptions {
7
- cleanupIntervalMs: number;
8
- onCleanup: () => void;
9
- }
10
-
11
- export class TimerManager {
12
- private timer: ReturnType<typeof setInterval> | null = null;
13
- private readonly options: TimerManagerOptions;
14
- private destroyed = false;
15
-
16
- constructor(options: TimerManagerOptions) {
17
- this.options = options;
18
- }
19
-
20
- /**
21
- * Start the cleanup timer
22
- * Idempotent: safe to call multiple times
23
- */
24
- start(): void {
25
- if (this.destroyed) {
26
- return; // Don't start if destroyed
27
- }
28
-
29
- // Clear existing timer if running (prevents duplicate timers)
30
- if (this.timer) {
31
- this.stop();
32
- }
33
-
34
- this.timer = setInterval(() => {
35
- if (this.destroyed) {
36
- this.stop();
37
- return;
38
- }
39
-
40
- try {
41
- this.options.onCleanup();
42
- } catch (error) {
43
- // Silently handle cleanup errors to prevent timer from causing issues
44
- // Log error in development for debugging (use __DEV__ for React Native)
45
- if (__DEV__) {
46
- console.error('TimerManager cleanup error:', error);
47
- }
48
- }
49
- }, this.options.cleanupIntervalMs);
50
-
51
- // In React Native, timers may not run when app is backgrounded
52
- // Unref the timer to allow the event loop to exit if this is the only active timer
53
- if (typeof (this.timer as any).unref === 'function') {
54
- (this.timer as any).unref();
55
- }
56
- }
57
-
58
- /**
59
- * Stop the cleanup timer
60
- */
61
- stop(): void {
62
- if (this.timer) {
63
- clearInterval(this.timer);
64
- this.timer = null;
65
- }
66
- }
67
-
68
- /**
69
- * Check if timer is running
70
- */
71
- isRunning(): boolean {
72
- return this.timer !== null && !this.destroyed;
73
- }
74
-
75
- /**
76
- * Destroy the timer manager
77
- * Prevents timer from restarting
78
- */
79
- destroy(): void {
80
- this.destroyed = true;
81
- this.stop();
82
- }
83
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Firebase App Initializer
3
- *
4
- * Single Responsibility: Expose Firebase App type
5
- */
6
-
7
- import type { FirebaseApp as FirebaseAppType } from 'firebase/app';
8
-
9
- export type FirebaseApp = FirebaseAppType;