Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit f20b12f

Browse files
[cloud_firestore] Fix wrong FieldValue (#1543)
* [cloud_firestore] Fix wrong FieldValue * Update integration test to catch increment
1 parent 8877eae commit f20b12f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,8 @@ final class FirestoreMessageCodec extends StandardMessageCodec {
654654
private static final byte DELETE = (byte) 134;
655655
private static final byte SERVER_TIMESTAMP = (byte) 135;
656656
private static final byte TIMESTAMP = (byte) 136;
657-
private static final byte INCREMENT_INTEGER = (byte) 137;
658-
private static final byte INCREMENT_DOUBLE = (byte) 138;
657+
private static final byte INCREMENT_DOUBLE = (byte) 137;
658+
private static final byte INCREMENT_INTEGER = (byte) 138;
659659

660660
@Override
661661
protected void writeValue(ByteArrayOutputStream stream, Object value) {

packages/cloud_firestore/example/test_driver/cloud_firestore.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ void main() {
5454
snapshot = await ref.get();
5555
expect(snapshot.data['message'], 2);
5656
await ref.updateData(<String, dynamic>{
57-
'message': FieldValue.increment(40.0),
57+
'message': FieldValue.increment(40.1),
5858
});
5959
snapshot = await ref.get();
60-
expect(snapshot.data['message'], 42.0);
60+
expect(snapshot.data['message'], 42.1);
6161
await ref.delete();
6262
});
6363

0 commit comments

Comments
 (0)