@react-native-firebase/database 23.8.8 → 24.1.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [24.1.0](https://github.com/invertase/react-native-firebase/compare/v24.0.0...v24.1.0) (2026-06-05)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **android:** catch RejectedExecutionException on executor-backed Tasks ([375ade9](https://github.com/invertase/react-native-firebase/commit/375ade9a043d2fd8180572ecc75c518e4428be84))
|
|
11
|
+
- **database, android:** remove RTDB listeners before shutting down executors ([25ed605](https://github.com/invertase/react-native-firebase/commit/25ed605cdb5b639f70ad7e96923d4a9acc2ff0d0))
|
|
12
|
+
|
|
13
|
+
## [24.0.0](https://github.com/invertase/react-native-firebase/compare/v23.8.6...v24.0.0) (2026-04-01)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @react-native-firebase/database
|
|
16
|
+
|
|
6
17
|
## [23.8.8](https://github.com/invertase/react-native-firebase/compare/v23.8.6...v23.8.8) (2026-03-12)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @react-native-firebase/database
|
|
@@ -43,8 +43,6 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
43
43
|
|
|
44
44
|
@Override
|
|
45
45
|
public void invalidate() {
|
|
46
|
-
super.invalidate();
|
|
47
|
-
|
|
48
46
|
Iterator refIterator = queryMap.entrySet().iterator();
|
|
49
47
|
while (refIterator.hasNext()) {
|
|
50
48
|
Map.Entry pair = (Map.Entry) refIterator.next();
|
|
@@ -53,6 +51,8 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
53
51
|
databaseQuery.removeAllEventListeners();
|
|
54
52
|
refIterator.remove(); // avoids a ConcurrentModificationException
|
|
55
53
|
}
|
|
54
|
+
|
|
55
|
+
super.invalidate();
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -101,15 +101,19 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
101
101
|
new ValueEventListener() {
|
|
102
102
|
@Override
|
|
103
103
|
public void onDataChange(@Nonnull DataSnapshot dataSnapshot) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
try {
|
|
105
|
+
Tasks.call(getExecutor(), () -> snapshotToMap(dataSnapshot))
|
|
106
|
+
.addOnCompleteListener(
|
|
107
|
+
task -> {
|
|
108
|
+
if (task.isSuccessful()) {
|
|
109
|
+
promise.resolve(task.getResult());
|
|
110
|
+
} else {
|
|
111
|
+
rejectPromiseWithExceptionMap(promise, task.getException());
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
} catch (java.util.concurrent.RejectedExecutionException e) {
|
|
115
|
+
rejectPromiseWithExceptionMap(promise, e);
|
|
116
|
+
}
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
@Override
|
|
@@ -139,17 +143,21 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
139
143
|
public void onChildAdded(@Nonnull DataSnapshot dataSnapshot, String previousChildName) {
|
|
140
144
|
if ("child_added".equals(eventType)) {
|
|
141
145
|
databaseQuery.removeEventListener(this);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
try {
|
|
147
|
+
Tasks.call(
|
|
148
|
+
getExecutor(),
|
|
149
|
+
() -> snapshotWithPreviousChildToMap(dataSnapshot, previousChildName))
|
|
150
|
+
.addOnCompleteListener(
|
|
151
|
+
task -> {
|
|
152
|
+
if (task.isSuccessful()) {
|
|
153
|
+
promise.resolve(task.getResult());
|
|
154
|
+
} else {
|
|
155
|
+
rejectPromiseWithExceptionMap(promise, task.getException());
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
} catch (java.util.concurrent.RejectedExecutionException e) {
|
|
159
|
+
rejectPromiseWithExceptionMap(promise, e);
|
|
160
|
+
}
|
|
153
161
|
}
|
|
154
162
|
}
|
|
155
163
|
|
|
@@ -157,17 +165,21 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
157
165
|
public void onChildChanged(@Nonnull DataSnapshot dataSnapshot, String previousChildName) {
|
|
158
166
|
if ("child_changed".equals(eventType)) {
|
|
159
167
|
databaseQuery.removeEventListener(this);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
try {
|
|
169
|
+
Tasks.call(
|
|
170
|
+
getExecutor(),
|
|
171
|
+
() -> snapshotWithPreviousChildToMap(dataSnapshot, previousChildName))
|
|
172
|
+
.addOnCompleteListener(
|
|
173
|
+
task -> {
|
|
174
|
+
if (task.isSuccessful()) {
|
|
175
|
+
promise.resolve(task.getResult());
|
|
176
|
+
} else {
|
|
177
|
+
rejectPromiseWithExceptionMap(promise, task.getException());
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
} catch (java.util.concurrent.RejectedExecutionException e) {
|
|
181
|
+
rejectPromiseWithExceptionMap(promise, e);
|
|
182
|
+
}
|
|
171
183
|
}
|
|
172
184
|
}
|
|
173
185
|
|
|
@@ -175,15 +187,19 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
175
187
|
public void onChildRemoved(@Nonnull DataSnapshot dataSnapshot) {
|
|
176
188
|
if ("child_removed".equals(eventType)) {
|
|
177
189
|
databaseQuery.removeEventListener(this);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
try {
|
|
191
|
+
Tasks.call(getExecutor(), () -> snapshotWithPreviousChildToMap(dataSnapshot, null))
|
|
192
|
+
.addOnCompleteListener(
|
|
193
|
+
task -> {
|
|
194
|
+
if (task.isSuccessful()) {
|
|
195
|
+
promise.resolve(task.getResult());
|
|
196
|
+
} else {
|
|
197
|
+
rejectPromiseWithExceptionMap(promise, task.getException());
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
} catch (java.util.concurrent.RejectedExecutionException e) {
|
|
201
|
+
rejectPromiseWithExceptionMap(promise, e);
|
|
202
|
+
}
|
|
187
203
|
}
|
|
188
204
|
}
|
|
189
205
|
|
|
@@ -191,17 +207,21 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
191
207
|
public void onChildMoved(@Nonnull DataSnapshot dataSnapshot, String previousChildName) {
|
|
192
208
|
if ("child_moved".equals(eventType)) {
|
|
193
209
|
databaseQuery.removeEventListener(this);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
210
|
+
try {
|
|
211
|
+
Tasks.call(
|
|
212
|
+
getExecutor(),
|
|
213
|
+
() -> snapshotWithPreviousChildToMap(dataSnapshot, previousChildName))
|
|
214
|
+
.addOnCompleteListener(
|
|
215
|
+
task -> {
|
|
216
|
+
if (task.isSuccessful()) {
|
|
217
|
+
promise.resolve(task.getResult());
|
|
218
|
+
} else {
|
|
219
|
+
rejectPromiseWithExceptionMap(promise, task.getException());
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
} catch (java.util.concurrent.RejectedExecutionException e) {
|
|
223
|
+
rejectPromiseWithExceptionMap(promise, e);
|
|
224
|
+
}
|
|
205
225
|
}
|
|
206
226
|
}
|
|
207
227
|
|
|
@@ -315,34 +335,39 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
|
|
|
315
335
|
DataSnapshot dataSnapshot,
|
|
316
336
|
@Nullable String previousChildName) {
|
|
317
337
|
final String eventRegistrationKey = registration.getString("eventRegistrationKey");
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
338
|
+
try {
|
|
339
|
+
Tasks.call(
|
|
340
|
+
getTransactionalExecutor(eventRegistrationKey),
|
|
341
|
+
() -> {
|
|
342
|
+
if (eventType.equals("value")) {
|
|
343
|
+
return snapshotToMap(dataSnapshot);
|
|
344
|
+
} else {
|
|
345
|
+
return snapshotWithPreviousChildToMap(dataSnapshot, previousChildName);
|
|
346
|
+
}
|
|
347
|
+
})
|
|
348
|
+
.addOnCompleteListener(
|
|
349
|
+
getExecutor(),
|
|
350
|
+
task -> {
|
|
351
|
+
if (task.isSuccessful()) {
|
|
352
|
+
WritableMap data = task.getResult();
|
|
353
|
+
WritableMap event = Arguments.createMap();
|
|
354
|
+
event.putMap("data", data);
|
|
355
|
+
event.putString("key", key);
|
|
356
|
+
event.putString("eventType", eventType);
|
|
357
|
+
event.putMap("registration", readableMapToWritableMap(registration));
|
|
358
|
+
|
|
359
|
+
ReactNativeFirebaseEventEmitter emitter =
|
|
360
|
+
ReactNativeFirebaseEventEmitter.getSharedInstance();
|
|
361
|
+
|
|
362
|
+
emitter.sendEvent(
|
|
363
|
+
new ReactNativeFirebaseDatabaseEvent(
|
|
364
|
+
ReactNativeFirebaseDatabaseEvent.EVENT_SYNC, event));
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
} catch (java.util.concurrent.RejectedExecutionException e) {
|
|
368
|
+
// Event arrived after module invalidation shut down an executor.
|
|
369
|
+
// Safe to drop when tearing down; no JS listener will consume the event.
|
|
370
|
+
}
|
|
346
371
|
}
|
|
347
372
|
|
|
348
373
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -273,7 +273,7 @@ export namespace FirebaseDatabaseTypes {
|
|
|
273
273
|
/**
|
|
274
274
|
* Sets a priority for the data at this Database location. Setting null removes any priority at this location.
|
|
275
275
|
*
|
|
276
|
-
* See {@link
|
|
276
|
+
* See {@link Query#orderByPriority} to learn how to use priority values in your query.
|
|
277
277
|
*
|
|
278
278
|
* #### Example
|
|
279
279
|
*
|
|
@@ -413,7 +413,7 @@ export namespace FirebaseDatabaseTypes {
|
|
|
413
413
|
push(value?: any, onComplete?: () => void): ThenableReference;
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
|
-
* Returns an {@link
|
|
416
|
+
* Returns an {@link OnDisconnect} instance.
|
|
417
417
|
*
|
|
418
418
|
* #### Example
|
|
419
419
|
*
|
|
@@ -497,7 +497,7 @@ export namespace FirebaseDatabaseTypes {
|
|
|
497
497
|
* Returns whether or not the current and provided queries represent the same location, have the same query parameters.
|
|
498
498
|
*
|
|
499
499
|
* Two Reference objects are equivalent if they represent the same location and are from the same instance of
|
|
500
|
-
* {@link app}. Equivalent queries share the same sort order, limits, and starting and ending points.
|
|
500
|
+
* {@link @firebase/app!FirebaseApp}. Equivalent queries share the same sort order, limits, and starting and ending points.
|
|
501
501
|
*
|
|
502
502
|
* #### Example
|
|
503
503
|
*
|
package/lib/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
module.exports = '
|
|
2
|
+
module.exports = '24.1.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/database",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.1.0",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Firebase - The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. React Native Firebase provides native integration with the Android & iOS Firebase SDKs, supporting both realtime data sync and offline capabilities.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"realtome database"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@react-native-firebase/app": "
|
|
28
|
+
"@react-native-firebase/app": "24.1.0"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public",
|
|
32
32
|
"provenance": true
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "804a51fd265453f2385adb0ac96a6abf992c0316"
|
|
35
35
|
}
|