Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/common/src/client/sync/stream/AbstractRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const KEEP_ALIVE_LIFETIME_MS = 90_000;
/**
* @internal
*/
export const DEFAULT_REMOTE_LOGGER = Logger.get('PowerSyncRemote');
export const DEFAULT_REMOTE_LOGGER: ILogger = Logger.get('PowerSyncRemote');

/**
* @internal
Expand Down
10 changes: 9 additions & 1 deletion packages/common/src/utils/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ const TypedLogger: ILogger = Logger as any;
/**
* @public
*/
export const LogLevel = {
export const LogLevel: {
TRACE: ILogLevel;
DEBUG: ILogLevel;
INFO: ILogLevel;
TIME: ILogLevel;
WARN: ILogLevel;
ERROR: ILogLevel;
OFF: ILogLevel;
} = {
TRACE: TypedLogger.TRACE,
DEBUG: TypedLogger.DEBUG,
INFO: TypedLogger.INFO,
Expand Down
8 changes: 4 additions & 4 deletions packages/node/tests/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
ProgressWithOperations,
Schema,
SyncClientImplementation,
SyncStreamConnectionMethod
SyncStreamConnectionMethod,
LogLevel,
} from '@powersync/common';
import Logger from 'js-logger';
import {
bucket,
MockSyncService,
Expand Down Expand Up @@ -602,7 +602,7 @@ function defineSyncTests(bson: boolean) {
});

mockSyncServiceTest('handles uploads across checkpoints', async ({ syncService }) => {
const logger = createLogger('test', { logLevel: (Logger as any).TRACE });
const logger = createLogger('test', { logLevel: LogLevel.TRACE });
const logMessages: string[] = [];
(logger as any).invoke = (level, args) => {
console.log(...args);
Expand Down Expand Up @@ -933,7 +933,7 @@ function defineSyncTests(bson: boolean) {

mockSyncServiceTest('can reconnect based on query changes', async ({ syncService }) => {
// Test for https://discord.com/channels/1138230179878154300/1399340612435710034/1399340612435710034
const logger = createLogger('test', { logLevel: (Logger as any).TRACE });
const logger = createLogger('test', { logLevel: LogLevel.TRACE });
const logMessages: string[] = [];
(logger as any).invoke = (level, args) => {
console.log(...args);
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/db/adapters/wa-sqlite/RawSqliteConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export class RawSqliteConnection {
);
await this.executeRaw(`PRAGMA temp_store = ${this.options.temporaryStorage};`);
if (this.options.encryptionKey) {
const escapedKey = this.options.encryptionKey.replace("'", "''");
await this.executeRaw(`PRAGMA key = '${escapedKey}'`);
const escapedKey = this.options.encryptionKey.replaceAll("'", "''");
await this.executeRaw(`PRAGMA key = '${escapedKey}';`);
}
await this.executeRaw(`PRAGMA cache_size = -${this.options.cacheSizeKb};`);

Expand Down
1 change: 1 addition & 0 deletions packages/web/webpack.workers.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default () => {
},
output: {
filename: 'worker/[name].umd.js',
chunkFilename: 'worker/[contenthash].umd.js',
path: path.join(__dirname, 'dist'),
library: {
name: 'sdk_web',
Expand Down