Skip to content

Commit d88bd20

Browse files
committed
fix(firestore, android): remove usage of Guava library WIP
there was only one usage of Guava in firestore, and it was easily replaced with a for loop which eliminates the dependency this is important in the context of firebase-android-sdk where guava is no longer transitively available - best to remove it here as well vs bring it in directly as a dependency we specifically we need WIP added logging to guava removed / new-algo in firestore serializer
1 parent 0aeeebc commit d88bd20

File tree

2 files changed

+34
-27
lines changed

2 files changed

+34
-27
lines changed

packages/firestore/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreSerialize.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import com.facebook.react.bridge.ReadableMapKeySetIterator;
2929
import com.facebook.react.bridge.WritableArray;
3030
import com.facebook.react.bridge.WritableMap;
31-
import com.google.common.collect.Iterables;
3231
import com.google.firebase.Timestamp;
3332
import com.google.firebase.firestore.Blob;
3433
import com.google.firebase.firestore.DocumentChange;
@@ -193,23 +192,31 @@ private static WritableArray documentChangesToWritableArray(
193192
@Nullable List<DocumentChange> comparableDocumentChanges) {
194193
WritableArray documentChangesWritable = Arguments.createArray();
195194

195+
Log.w(TAG, "SDK33 in documentChangesToWritableArray");
196+
196197
boolean checkIfMetadataChange = comparableDocumentChanges != null;
198+
Log.w(TAG, "SDK33 checkIfMetadataChange is " + checkIfMetadataChange);
199+
Log.w(TAG, "SDK33 documentChanges size: " + documentChanges.size());
197200

198201
for (DocumentChange documentChange : documentChanges) {
199-
boolean isMetadataChange = false;
202+
boolean isMetadataChange = true;
200203
if (checkIfMetadataChange) {
201204
int hashCode = documentChange.hashCode();
202-
DocumentChange exists =
203-
Iterables.tryFind(
204-
comparableDocumentChanges, docChange -> docChange.hashCode() == hashCode)
205-
.orNull();
206-
207-
// Exists in docChanges with meta, but doesnt exist in docChanges without meta
208-
if (exists == null) {
209-
isMetadataChange = true;
205+
Log.w(TAG, "SDK33 examining change with hashCode " + hashCode);
206+
Log.w(TAG, "SDK33 comp changes size " + comparableDocumentChanges.size());
207+
// is a metadata-only change if exists in docChanges with meta,
208+
// but doesnt exist in docChanges without meta
209+
for (DocumentChange comparableDocumentChange : comparableDocumentChanges) {
210+
Log.w(TAG, "SDK33 comp change with hashCode " + hashCode);
211+
if (comparableDocumentChange.hashCode() == hashCode) {
212+
isMetadataChange = false;
213+
Log.w(TAG, "SDK33 we have a match! it is not just a metadata change");
214+
break;
215+
}
210216
}
211217
}
212218

219+
Log.w(TAG, "SDK33 push doc " + documentChange.hashCode() + " isMetadataChange: " + isMetadataChange);
213220
documentChangesWritable.pushMap(
214221
documentChangeToWritableMap(appName, documentChange, isMetadataChange));
215222
}

tests/e2e/.mocharc.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ module.exports = {
55
timeout: 1000000,
66
reporter: 'spec',
77
slow: 2000,
8-
retries: 4,
8+
retries: 0,
99
bail: true,
1010
exit: true,
1111
require: 'node_modules/jet/platform/node',
1212
spec: [
13-
'../packages/app/e2e/**/*.e2e.js',
14-
'../packages/app-check/e2e/**/*.e2e.js',
15-
'../packages/app-distribution/e2e/**/*.e2e.js',
16-
'../packages/analytics/e2e/**/*.e2e.js',
17-
'../packages/auth/e2e/**/*.e2e.js',
18-
'../packages/crashlytics/e2e/**/*.e2e.js',
19-
'../packages/database/e2e/**/*.e2e.js',
20-
'../packages/dynamic-links/e2e/**/*.e2e.js',
13+
// '../packages/app/e2e/**/*.e2e.js',
14+
// '../packages/app-check/e2e/**/*.e2e.js',
15+
// '../packages/app-distribution/e2e/**/*.e2e.js',
16+
// '../packages/analytics/e2e/**/*.e2e.js',
17+
// '../packages/auth/e2e/**/*.e2e.js',
18+
// '../packages/crashlytics/e2e/**/*.e2e.js',
19+
// '../packages/database/e2e/**/*.e2e.js',
20+
// '../packages/dynamic-links/e2e/**/*.e2e.js',
2121
'../packages/firestore/e2e/**/*.e2e.js',
22-
'../packages/functions/e2e/**/*.e2e.js',
23-
'../packages/perf/e2e/**/*.e2e.js',
24-
'../packages/messaging/e2e/**/*.e2e.js',
25-
'../packages/ml/e2e/**/*.e2e.js',
26-
'../packages/in-app-messaging/e2e/**/*.e2e.js',
27-
'../packages/installations/e2e/**/*.e2e.js',
28-
'../packages/remote-config/e2e/**/*.e2e.js',
29-
'../packages/storage/e2e/**/*.e2e.js',
22+
// '../packages/functions/e2e/**/*.e2e.js',
23+
// '../packages/perf/e2e/**/*.e2e.js',
24+
// '../packages/messaging/e2e/**/*.e2e.js',
25+
// '../packages/ml/e2e/**/*.e2e.js',
26+
// '../packages/in-app-messaging/e2e/**/*.e2e.js',
27+
// '../packages/installations/e2e/**/*.e2e.js',
28+
// '../packages/remote-config/e2e/**/*.e2e.js',
29+
// '../packages/storage/e2e/**/*.e2e.js',
3030
],
3131
};

0 commit comments

Comments
 (0)