1
0
Fork 0
Commit Graph

2 Commits (d918d56a7eb6e553c319dca14ee613be32d38ee8)

Author SHA1 Message Date
Mike Gerwitz c33adee21d client: Truncate diff posted to server after first null
Before this change, since `undefined' is encoded as `null' when serialized,
there was no way for the server to disambiguate between unmodified values
and a truncation point.  For example:

  [ undefined, undefined, null, null, null ]

The above array represents two unmodified and three removed indexes.  But
this is serialzed into JSON as:

  [ null, null, null, null, null ]

It isn't possible for the server to determine what the truncation point is
from that diff.  The solution is to therefore truncate the array _before_
sending it to the server, providing a trailing null to indicate that a
truncation has occurred:

  [ null, null, null ]

The above means that the first two indexes are unmodified, and that index 2
and later should all be truncated.

* doc/client.texi (Saving to Server): New section.
* src/client/transport/XhttpQuoteTransport.js (_truncateDiff): New method to
  perform truncation.
  (getBucketDataJson): Use it.
* test/client/transport/XhttpQuoteTransportTest.js: New file with respective
  test case.
2018-03-07 13:46:05 -05:00
Mike Gerwitz d2dd963614 doc: Extract design sections into own chapters
* assert.texi, bucket.texi, client.texi, pred.texi, program.texi,
  validation.texi: New files.
* design.texi: Extract text into above.
* liza.texi: Add @menu references and @include each new file.
2017-06-21 10:52:46 -04:00