ValueStore caches Values that are read out of it, but it doesn't
do the same for Values that are written. This is because we expect
that reading Values shortly after writing them is an uncommon usage
pattern, and because the Chunks that make up novel Values are
generally efficiently retrievable from the BatchStore that backs
a ValueStore. The problem discovered in issue #2802 is that ValueStore
caches non-existence as well as existence of read Values. So, reading
a Value that doesn't exist in the DB would result in the ValueStore
permanently returning nil for that Value -- even if you then go and
write it to the DB.
This patch drops the cache entry for a Value whenever it's written.
Fixes#2802
The big change here is adding a new Spec class in spec.js. This replaces
DatabaseSpec/DatasetSpec/PathSpec in specs.js, but I'm leaving those in
and moving code over in a later patch. For now, only photos UI.
The photos UI change is to plumb through the authorization token through
the Spec code. For now, it's reading it from a URL parameter, but soon
I'll make it session based (probably localStorage).
The demo-server change is to add the Authorization header into CORS.
It wasn't working on the code coverage tests. Now I restored this
to what it was before these changes (minus removing some features
that chrome and node now supports out of the box)
Rename the package to eslint-config-noms as documented on the eslint
site.
This allows other npm modules to use and `extends: 'noms'` in their
eslint rc file.
Previously we would clone them from the original cursor, to (a) not
modify the original cursor, and (b) have initialization and finalization
not interfere with each other.
However, this isn't necessary and it just creates unnecessary churn. For
example, when we read-ahead, it would be wasteful to re-read the
read-head chunks from initialization.
This puts the flow header after the copyright header.
It also:
* fixes the existing files to have valid headers
* Makes sure the script can handle doctype
The code in fetch.js and http_batch_store.js weren't really
agreeing on how HTTP failures were reported up the stack. Now,
they agree, and this allows HttpBatchStore.updateRoot() to
correctly detect a conflict response and return false.
This means that the merge logic in Database.commit() works right,
now.
Fixes#2699
This allows setting a field in a struct to a new type or to set a
non-existig field in a struct.
In JS this is done through the StructMirror.p.set and in Go this is
done through Struct Set.
Fixes#2181
This allows setting the meta field when you commit.
This is a version change because the signature of Database commit
changed in a non backwards compatible way. It now takes an optional
third options object instead of an optional array.
Noms SDK users frequently shoot themselves in the foot because they're
holding onto an "old" Database object. That is, they have a Database
tucked away in some internal state, they call Commit() on it, and
don't replace the object in their internal state with the new Database
returned from Commit.
This PR fixes#2589 by changing the Database and Dataset JS API to be
in line with the proposal there.
We used to use a third party module that allocated new buffers all
the time. For Noms, we already have a buffer that we want to write
to.
For the rolling hash we use a scratch buffer that we reuse between
calls.
This also removes the DataView objects. Our usage is so basic that
having a DataView object wrapper is just overkill.
Fixes#2304
DashCast makes the background color black, which makes sense for
displaying on a TV screen anyway - easier on the eyes, less distracting,
probably less power usage. Looks fine black on a computer screen too.
The 'ds' parameter can now have multiple comma separated datasets, and
every time the page refreshes (which now happens programmatically, not
via location.reload) it shows the next.