Skip to content

Add DevTools extension#406

Merged
simolus3 merged 7 commits into
mainfrom
devtools-extension
May 4, 2026
Merged

Add DevTools extension#406
simolus3 merged 7 commits into
mainfrom
devtools-extension

Conversation

@simolus3
Copy link
Copy Markdown
Contributor

@simolus3 simolus3 commented Apr 17, 2026

Flutter and Dart DevTools are a collection of debuggers and inspectors for Dart apps. Packages can contribute additional tools, and I think this could be interesting for PowerSync! This adds an extension to the powersync package. It currently has two pages, which provide these features:

Overview

grafik

This page shows the full path of the database (which may be convenient when path_provider is used and one wants to inspect a local database file), potential sync issues (a warning is shown for pending ps_crud rows and when the $local bucket is waiting for a checkpoint). This also exports the current token and endpoint passed to PowerSync, these values can be inspected and a deeplink can be used to open the same session in the full diagnostics app.

SQL console

grafik

This page is also inspired from the diagnostics app, it can be used to run queries against the live database in the app. There are buttons to help select from all tables in the schema (including raw tables).

How it works

Dart code can provide RPC entrypoints to invoke functions through the VM service protocol used by DevTools. Outside of release builds we do that to provide commands listing all opened PowerSync instances, to run queries or to post notifications on table and sync status changes.

In the DevTools extension, we use these RPC entrypoints to obtain a remote database instance we can use to run queries and to observe the sync status. This allows building the UI pages almost as if the PowerSync database was active in the extension itself.

There's a lot more potential here: We could also show buckets with download information through the new diagnostics protocol of the core extension. This is about as far as I could get in a hackday though, and I don't think it makese sense to invest much more time into it. We don't need this to overlap with the diagnostics app either, it's good enough to show obvious issues and can deeplink to diagnostics for anything more complex than that.

@simolus3 simolus3 force-pushed the devtools-extension branch from 1012ecb to cde734e Compare April 29, 2026 14:01
@simolus3 simolus3 marked this pull request as ready for review April 29, 2026 15:15
@simolus3 simolus3 requested a review from stevensJourney April 29, 2026 15:22
stevensJourney
stevensJourney previously approved these changes May 4, 2026
Copy link
Copy Markdown
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really cool!
I added the Product Visibility label to this PR - since I assume we might want to document this feature in the docs.

Comment thread .github/workflows/publish.yml Outdated
@simolus3 simolus3 merged commit 373e862 into main May 4, 2026
6 checks passed
@simolus3 simolus3 deleted the devtools-extension branch May 4, 2026 11:19
},
),
ButtonGroupItemData(
label: 'Open in Diagnostics App',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be called Sync Diagnostics Client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants