powersync-ja / powersync.dart

SDK that enables local-first and real-time reactive apps with embedded SQLite for Flutter/Dart clients
https://www.powersync.com
133 stars 18 forks source link

supabase-todolist Demo App - SupabaseConnector does not need a db instance #165

Closed JavascriptMick closed 2 months ago

JavascriptMick commented 2 months ago

Pretty sure there is an unnecessary and, frankly confusing mistake in the supabase-todolist demo code.

e.g. this file.... https://github.com/powersync-ja/powersync.dart/blob/main/demos/supabase-todolist/lib/powersync.dart

From Line 28

class SupabaseConnector extends PowerSyncBackendConnector {
  PowerSyncDatabase db;

  Future<void>? _refreshFuture;

  SupabaseConnector(this.db);

the db instance is not used inside the class or by users of the class. Smells like a refactor happened and this was left in. I was able to rip the property out and run the demo app just fine...

class SupabaseConnector extends PowerSyncBackendConnector {
  Future<void>? _refreshFuture;

  SupabaseConnector();
mugikhan commented 2 months ago

Thanks for reporting this @JavascriptMick we've removed the unnecessary db instances in the connectors for all the demos.