diff --git a/lib/IHP/DataSync/ihp-datasync.js b/lib/IHP/DataSync/ihp-datasync.js index 3c981fa33..345834fb2 100644 --- a/lib/IHP/DataSync/ihp-datasync.js +++ b/lib/IHP/DataSync/ihp-datasync.js @@ -251,7 +251,17 @@ class DataSubscription { this.connectError = null; this.subscriptionId = null; this.subscribers = []; - this.records = cache ? cache.get(JSON.stringify(query)) || [] : []; + + if (cache) { + const cacheResults = cache.get(JSON.stringify(query)); + if (cacheResults !== undefined) { + this.records = cacheResults; + } else { + this.records = null; + } + } else { + this.records = null; + } this.cache = cache; this.getRecords = this.getRecords.bind(this);