@powersync/web 1.20.1 → 1.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -39625,6 +39625,9 @@ class SharedSyncClientProvider extends _worker_sync_AbstractSharedSyncClientProv
39625
39625
  const { port } = await this.webDB.shareConnection();
39626
39626
  return comlink__WEBPACK_IMPORTED_MODULE_0__.transfer(port, [port]);
39627
39627
  }
39628
+ invalidateCredentials() {
39629
+ this.options.remote.invalidateCredentials();
39630
+ }
39628
39631
  async fetchCredentials() {
39629
39632
  const credentials = await this.options.remote.getCredentials();
39630
39633
  if (credentials == null) {
@@ -40466,6 +40469,16 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
40466
40469
  return new _db_sync_WebStreamingSyncImplementation__WEBPACK_IMPORTED_MODULE_4__.WebStreamingSyncImplementation({
40467
40470
  adapter: new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.SqliteBucketStorage(this.dbAdapter, new async_mutex__WEBPACK_IMPORTED_MODULE_1__.Mutex(), this.logger),
40468
40471
  remote: new _db_sync_WebRemote__WEBPACK_IMPORTED_MODULE_3__.WebRemote({
40472
+ invalidateCredentials: async () => {
40473
+ const lastPort = this.ports[this.ports.length - 1];
40474
+ try {
40475
+ this.logger.log('calling the last port client provider to invalidate credentials');
40476
+ lastPort.clientProvider.invalidateCredentials();
40477
+ }
40478
+ catch (ex) {
40479
+ this.logger.error('error invalidating credentials', ex);
40480
+ }
40481
+ },
40469
40482
  fetchCredentials: async () => {
40470
40483
  const lastPort = this.ports[this.ports.length - 1];
40471
40484
  return new Promise(async (resolve, reject) => {
@@ -40487,7 +40500,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
40487
40500
  }
40488
40501
  });
40489
40502
  }
40490
- }),
40503
+ }, this.logger),
40491
40504
  uploadCrud: async () => {
40492
40505
  const lastPort = this.ports[this.ports.length - 1];
40493
40506
  return new Promise(async (resolve, reject) => {