[GH-ISSUE #15] Using missing cache value instead of server value #13

Closed
opened 2026-05-23 08:34:09 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @appy-one on GitHub (Nov 11, 2021).
Original GitHub issue: https://github.com/appy-one/acebase-client/issues/15

Originally assigned to: @appy-one on GitHub.

I discovered an issue where .get API method returns a null (non-existent) value from cache upon timeout, because the server value is large and takes some time to download. In this case it MUST wait for the server value to arrive, and NOT use the value from cache. After some research, I discovered this is caused by a recent commit in web-api.js:1588 - val is now an object containing both value and context, but in line 1595 it still uses val instead of value to check for existence; so .get will return null as the current value. This is a major problem for live data proxies that use a default value if the target path does not exist, because it will overwrite the value after this faulty response!

Note this only applies to AceBaseClient's using a local cache database, when fetching a value from the server that takes more than a second to load (1000ms is the timeout for delivering the cached value)

Originally created by @appy-one on GitHub (Nov 11, 2021). Original GitHub issue: https://github.com/appy-one/acebase-client/issues/15 Originally assigned to: @appy-one on GitHub. I discovered an issue where `.get` API method returns a `null` (non-existent) value from cache upon timeout, because the server value is large and takes some time to download. In this case it MUST wait for the server value to arrive, and NOT use the value from cache. After some research, I discovered this is caused by a recent [commit](https://github.com/appy-one/acebase-client/commit/2189652db8a952e9e3a7e8b33c27f120242455d5) in web-api.js:1588 - `val` is now an object containing both `value` and `context`, but in line 1595 it still uses `val` instead of `value` to check for existence; so `.get` will return `null` as the current value. This is a major problem for live data proxies that use a default value if the target path does not exist, because it will overwrite the value after this faulty response! Note this only applies to `AceBaseClient`'s using a local cache database, when fetching a value from the server that takes more than a second to load (1000ms is the timeout for delivering the cached value)
gitea-mirror 2026-05-23 08:34:09 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@appy-one commented on GitHub (Nov 11, 2021):

Fix published with acebase-client 1.8.2

<!-- gh-comment-id:966180101 --> @appy-one commented on GitHub (Nov 11, 2021): Fix published with `acebase-client` 1.8.2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase-client#13
No description provided.