simpla icon indicating copy to clipboard operation
simpla copied to clipboard

Implicitly created hierarchies should hydrate from API

Open bedeoverend opened this issue 7 years ago • 0 comments

Scenario

Calling Simpla.set('foo.bar.baz', { ... }), before having calling set / get on either ancestor foo or foo.bar, may result in incorrect data being stored in the buffer for foo and foo.bar - meaning that calling Simpla.get on either may return incorrect data.

Expected behaviour

Calling Simpla.get('foo.bar') will always respond with the data previously saved and stored remotely, or, data that's been explicitly set locally via Simpla.set('foo.bar')

Actual behaviour

Simpla.get('foo.bar') may return blank data, even though data has been set to the API.

Analysis

Calling Simpla.set('foo.bar.baz', { ... }) will cause the SDK to ensure that foo and foo.bar exist in the buffer, even if just blank - to replicate the functionality of the remote API. Instead, if it doesn't exist in the buffer, it should check if it doesn't exist in the remote API, then should set blank data iff it doesn't exist there.

bedeoverend avatar Mar 05 '17 20:03 bedeoverend