toJson method
This mutation as a device sends it.
The queue is on a phone and the table is on a server, so replay is a
request whether or not anything has written that request yet. Both
times go: lastWriteWins resolves on correctedTime, and
deviceTime is what the device's own user saw. base goes because
the server checks the queued write against the version this device
last saw acknowledged, and a write that arrives without one is a blind
write.
Implementation
Map<String, Object?> toJson() => <String, Object?>{
'mutationId': mutationId,
'sequence': sequence,
'table': table,
'op': op,
'key': key,
'values': values,
'deviceTime': deviceTime.toIso8601String(),
'correctedTime': correctedTime.toIso8601String(),
if (base != null)
'base': <String, Object?>{
'key': base!.key,
'version': base!.version,
'values': base!.values,
},
};