From fead4078c7d3099068635fe146369d527bc76bf6 Mon Sep 17 00:00:00 2001 From: morrys Date: Tue, 27 Apr 2021 12:43:07 +0200 Subject: [PATCH 1/2] fix purge notify --- packages/relay-offline/package.json | 2 +- packages/relay-store/package.json | 2 +- packages/relay-store/src/Store.ts | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/relay-offline/package.json b/packages/relay-offline/package.json index b542a39..2255c7b 100644 --- a/packages/relay-offline/package.json +++ b/packages/relay-offline/package.json @@ -1,6 +1,6 @@ { "name": "@wora/relay-offline", - "version": "5.0.0", + "version": "5.0.1", "keywords": [ "wora", "cache-persist", diff --git a/packages/relay-store/package.json b/packages/relay-store/package.json index 1fbbd3e..20e3c59 100644 --- a/packages/relay-store/package.json +++ b/packages/relay-store/package.json @@ -1,6 +1,6 @@ { "name": "@wora/relay-store", - "version": "5.0.0", + "version": "5.0.1", "keywords": [ "cache", "wora", diff --git a/packages/relay-store/src/Store.ts b/packages/relay-store/src/Store.ts index c8c3481..467c346 100644 --- a/packages/relay-store/src/Store.ts +++ b/packages/relay-store/src/Store.ts @@ -52,7 +52,9 @@ export class Store extends RelayModernStore { public purge(): Promise { const updateRecords = (this as any).__getUpdatedRecordIDs(); - Object.keys((this as any).getSource().toJSON()).forEach((key) => (updateRecords[key] = true)); + Object.keys((this as any)._store.getSource().toJSON()).forEach((key) => { + updateRecords.add(key); + }); this._cache.purge(); return Promise.all([this._cache.flush(), (this as any)._recordSource.purge()]).then((result) => { this.notify(); From 8416d31fd604dbdeebf40faaea02a9461210becc Mon Sep 17 00:00:00 2001 From: morrys Date: Tue, 27 Apr 2021 12:53:38 +0200 Subject: [PATCH 2/2] Update Store.ts --- packages/relay-store/src/Store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/relay-store/src/Store.ts b/packages/relay-store/src/Store.ts index 467c346..4191bea 100644 --- a/packages/relay-store/src/Store.ts +++ b/packages/relay-store/src/Store.ts @@ -52,7 +52,7 @@ export class Store extends RelayModernStore { public purge(): Promise { const updateRecords = (this as any).__getUpdatedRecordIDs(); - Object.keys((this as any)._store.getSource().toJSON()).forEach((key) => { + Object.keys((this as any).getSource().toJSON()).forEach((key) => { updateRecords.add(key); }); this._cache.purge();