Skip to content

Commit

Permalink
[cloud_firestore] Fix wrong FieldValue (firebase#1543)
Browse files Browse the repository at this point in the history
* [cloud_firestore] Fix wrong FieldValue

* Update integration test to catch increment
  • Loading branch information
creativecreatorormaybenot authored and collinjackson committed Apr 29, 2019
1 parent 1551096 commit 06643a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ final class FirestoreMessageCodec extends StandardMessageCodec {
private static final byte DELETE = (byte) 134;
private static final byte SERVER_TIMESTAMP = (byte) 135;
private static final byte TIMESTAMP = (byte) 136;
private static final byte INCREMENT_INTEGER = (byte) 137;
private static final byte INCREMENT_DOUBLE = (byte) 138;
private static final byte INCREMENT_DOUBLE = (byte) 137;
private static final byte INCREMENT_INTEGER = (byte) 138;

@Override
protected void writeValue(ByteArrayOutputStream stream, Object value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ void main() {
snapshot = await ref.get();
expect(snapshot.data['message'], 2);
await ref.updateData(<String, dynamic>{
'message': FieldValue.increment(40.0),
'message': FieldValue.increment(40.1),
});
snapshot = await ref.get();
expect(snapshot.data['message'], 42.0);
expect(snapshot.data['message'], 42.1);
await ref.delete();
});

Expand Down

0 comments on commit 06643a1

Please sign in to comment.