Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/honest-melons-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@powersync/web': patch
---

Fixed issue where broadcast logger wasn't being passed to WebRemote, causing worker remote logs not to be broadcasted to the tab's logs.
47 changes: 25 additions & 22 deletions packages/web/src/worker/sync/SharedSyncImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,28 +306,31 @@ export class SharedSyncImplementation
// Create a new StreamingSyncImplementation for each connect call. This is usually done is all SDKs.
return new WebStreamingSyncImplementation({
adapter: new SqliteBucketStorage(this.dbAdapter!, new Mutex(), this.logger),
remote: new WebRemote({
fetchCredentials: async () => {
const lastPort = this.ports[this.ports.length - 1];
return new Promise(async (resolve, reject) => {
const abortController = new AbortController();
this.fetchCredentialsController = {
controller: abortController,
activePort: lastPort
};

abortController.signal.onabort = reject;
try {
this.logger.log('calling the last port client provider for credentials');
resolve(await lastPort.clientProvider.fetchCredentials());
} catch (ex) {
reject(ex);
} finally {
this.fetchCredentialsController = undefined;
}
});
}
}),
remote: new WebRemote(
{
fetchCredentials: async () => {
const lastPort = this.ports[this.ports.length - 1];
return new Promise(async (resolve, reject) => {
const abortController = new AbortController();
this.fetchCredentialsController = {
controller: abortController,
activePort: lastPort
};

abortController.signal.onabort = reject;
try {
this.logger.log('calling the last port client provider for credentials');
resolve(await lastPort.clientProvider.fetchCredentials());
} catch (ex) {
reject(ex);
} finally {
this.fetchCredentialsController = undefined;
}
});
}
},
this.logger
),
uploadCrud: async () => {
const lastPort = this.ports[this.ports.length - 1];

Expand Down