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
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ final class DartSdkIntegration(final Ref _ref) {
await db.request('disconnect');
case ActionName.clearData:
await db.request('clear-data');
await db.request('reconnect');
case ActionName.requestCheckpoint:
await db.request('request-checkpoint');
case ActionName.subscribeStream:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ final databaseList = FutureProvider.autoDispose<List<DatabaseReference>>((
final list = await service.callServiceExtension(
'ext.powersync.list',
isolateId: isolate.id,
args: {'includeToken': 'true'},
);

final databases = list.json!['databases'] as List;
Expand Down
7 changes: 6 additions & 1 deletion packages/powersync/lib/src/devtools/extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ final class PowerSyncDevToolsExtension {
});

registerExtension('ext.powersync.list', (method, parameters) async {
// Tokens are only included when explicitly requested, so that clients
// only interested in listing databases (e.g. coding agents) don't
// receive them.
final includeToken = parameters['includeToken'] == 'true';

return ServiceExtensionResponse.result(
json.encode({
'databases': [
Expand All @@ -193,7 +198,7 @@ final class PowerSyncDevToolsExtension {
null => null,
final credentials => {
'endpoint': credentials.endpoint,
'token': credentials.token,
if (includeToken) 'token': credentials.token,
},
},
'options': switch (db.lastConnectOptions) {
Expand Down
Loading