Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: swellstores/swell-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.3.0
Choose a base ref
...
head repository: swellstores/swell-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.4.0
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Oct 2, 2023

  1. rm $flushCache handling (#22)

    server-side will use _global versioning instead
    swellmike authored Oct 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    897ce25 View commit details

Commits on Oct 4, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    38ddb13 View commit details
  2. 5.4.0

    swellmike committed Oct 4, 2023
    Copy the full SHA
    07698c7 View commit details
Showing with 3 additions and 29 deletions.
  1. +0 −10 lib/cache/index.js
  2. +0 −6 lib/client.js
  3. +0 −10 lib/client.test.js
  4. +2 −2 package-lock.json
  5. +1 −1 package.json
10 changes: 0 additions & 10 deletions lib/cache/index.js
Original file line number Diff line number Diff line change
@@ -223,16 +223,6 @@ class Cache {
) {
this.putVersion(collection, version);
invalid[collection] = true;
// Hack to make admin.settings affect other api.settings
// TODO: figure out how to do this on the server side
if (collection === 'admin.settings') {
const versionCollections = Object.keys(this.versions);
for (const verCollection of versionCollections) {
if (String(verCollection).match(/\.settings$/)) {
invalid[verCollection] = true;
}
}
}
}
}

6 changes: 0 additions & 6 deletions lib/client.js
Original file line number Diff line number Diff line change
@@ -351,12 +351,6 @@ class Client extends EventEmitter {
return;
}

if (response.$flushCache) {
// Flush the entire cache.
this.cache.flush();
return;
}

if (response.$cached) {
// Invalidate a single entry in the cache.
if (this.params.debug) {
10 changes: 0 additions & 10 deletions lib/client.test.js
Original file line number Diff line number Diff line change
@@ -813,16 +813,6 @@ describe('Client', () => {
});
});

it('flushes the cache', () => {
client.onPush({ $flushCache: true });

// Nothing should be cached.
expect(client.cache.getVersions()).toEqual({});
expect(client.cache.getIndex()).toEqual({});
expect(client.cache.get('/foo', {})).toBe(null);
expect(client.cache.get('/bar', {})).toBe(null);
});

it('invalidates a cached collection entry', () => {
client.onPush({ $cached: { foo: 2 } });

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swell-node",
"version": "5.3.0",
"version": "5.4.0",
"description": "Swell API library for NodeJS",
"engines": {
"node": ">=14.19.1",