I think this is a bug in the PowerSync Capacitor path on iOS.
Sync fails with:
Run: failed(message: "Error in reading buffer")
I traced line_binary payloads getting passed into control() in SqliteBucketStorage.ts#L366
which calls:
tx.executeRaw('SELECT powersync_control(?, ?)', [op, payload])
In this specific case the params look like:
["line_binary", Uint8Array(...)]
PowerSync side:
Capacitor SQLite iOS side:
I think the fix probably belongs in PowerSync, at the Capacitor/native boundary. Normalizing Uint8Array before passing it into SQLite on iOS fixes it locally.
I think this is a bug in the PowerSync Capacitor path on iOS.
Sync fails with:
I traced
line_binarypayloads getting passed intocontrol()inSqliteBucketStorage.ts#L366which calls:
In this specific case the params look like:
PowerSync side:
line_binarycommand:BucketStorageAdapter.ts#L71powersync_controlcall:SqliteBucketStorage.ts#L368Capacitor SQLite iOS side:
run(...):CapacitorSQLite.swift#L888Error in reading buffer:CapacitorSQLite.swift#L898I think the fix probably belongs in PowerSync, at the Capacitor/native boundary. Normalizing
Uint8Arraybefore passing it into SQLite on iOS fixes it locally.