Simplifies the Store state by eliminating the data and metadata state variables - they were not being updated properly anyway
data and metadata are pulled directly from the doc state variable when passing to StoreConsumer
Fixed a bug where the revision number was not being updated - this caused any change from our components to be reflected back from the database, leading to extra rendering
No longer pass upsertDoc() to StoreConsumer - none of our components was using it anyway
Added upsertMetadata() for future use.
I tested by changing input values and checking that those changes did not cause extra renders since it now correctly updates the revision value. By temporarily inserting console.log's, I verified that the revisions and rendering were working as expected.
However, there is a mystery: For each update to the database, two identical on change messages are sent to our web app. Since the revision values are the same, it does no harm, but it is still a mystery.
These changes may fix some of our issues around cursor jumping, but I did not check that.
This fixes a couple of problems with the Store.
data
andmetadata
state variables - they were not being updated properly anywaydoc
state variable when passing to StoreConsumerupsertDoc()
to StoreConsumer - none of our components was using it anywayupsertMetadata()
for future use.I tested by changing input values and checking that those changes did not cause extra renders since it now correctly updates the revision value. By temporarily inserting console.log's, I verified that the revisions and rendering were working as expected.
However, there is a mystery: For each update to the database, two identical on change messages are sent to our web app. Since the revision values are the same, it does no harm, but it is still a mystery.
These changes may fix some of our issues around cursor jumping, but I did not check that.