Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(supabase-integration): Invalid argument(s): Field primaryKey on Customer is not serialized by Supabase #424

Closed
devj3ns opened this issue Aug 27, 2024 · 2 comments

Comments

@devj3ns
Copy link
Contributor

devj3ns commented Aug 27, 2024

Since the adapter issues are fixed, I could run my app to further test the new Supabase integration.

Unfortunately, the following exception was thrown:

E/flutter ( 5671): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Field primaryKey on Customer is not serialized by Supabase
E/flutter ( 5671): #0      QuerySupabaseTransformer.expandCondition 
Full Stack trace
(package:brick_supabase/src/query_supabase_transformer.dart:121:7)
E/flutter ( 5671): #1      QuerySupabaseTransformer.select.<anonymous closure> (package:brick_supabase/src/query_supabase_transformer.dart:44:30)
E/flutter ( 5671): #2      ListBase.fold (dart:collection/list.dart:202:22)
E/flutter ( 5671): #3      QuerySupabaseTransformer.select (package:brick_supabase/src/query_supabase_transformer.dart:43:33)
E/flutter ( 5671): #4      SupabaseProvider.get (package:brick_supabase/src/supabase_provider.dart:70:38)
E/flutter ( 5671): #5      OfflineFirstRepository.hydrate (package:brick_offline_first/src/offline_first_repository.dart:451:53)
E/flutter ( 5671): #6      OfflineFirstRepository.get (package:brick_offline_first/src/offline_first_repository.dart:209:22)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #7      OfflineFirstRepository.getAssociation (package:brick_offline_first/src/offline_first_repository.dart:229:21)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #8      _$ProjectFromSqlite (package:tragwerk_app/brick/adapters/project_adapter.g.dart:63:18)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #9      ProjectAdapter.fromSqlite (package:tragwerk_app/brick/adapters/project_adapter.g.dart:311:7)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #10     Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #11     SqliteProvider.rawGet (package:brick_sqlite/src/sqlite_provider.dart:224:12)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #12     SqliteProvider.get (package:brick_sqlite/src/sqlite_provider.dart:130:12)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #13     OfflineFirstRepository.hydrate.<anonymous closure> (package:brick_offline_first/src/offline_first_repository.dart:462:17)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #14     OfflineFirstRepository.hydrate (package:brick_offline_first/src/offline_first_repository.dart:460:14)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #15     OfflineFirstRepository.get (package:brick_offline_first/src/offline_first_repository.dart:209:16)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #16     OfflineFirstRepository.getBatched.getFrom (package:brick_offline_first/src/offline_first_repository.dart:269:23)
E/flutter ( 5671): <asynchronous suspension>
E/flutter ( 5671): #17     OfflineFirstRepository.getBatched (package:brick_offline_first/src/offline_first_repository.dart:284:12)
E/flutter ( 5671): <asynchronous suspension>

(Originally the error ends with "...not serialized by SQLite" as seen here, I guess this is a typo and should be "...not serialized by Supabase".)

It gets thrown when I batch query the Projects, which have an associated customer.

This is the code inside the _$ProjectFromSqlite which includes the where clause with the primaryKey field which leads to the error:

customer: (await repository!.getAssociation<Customer>(
        Query.where('primaryKey', data['customer_Customer_brick_id'] as int, limit1: true),
      ))!.first,
tshedor added a commit that referenced this issue Aug 27, 2024
@tshedor
Copy link
Collaborator

tshedor commented Aug 27, 2024

Resolving in #426

@tshedor
Copy link
Collaborator

tshedor commented Aug 27, 2024

#426 has been merged to supabase-integration and has been published

@tshedor tshedor closed this as completed Aug 27, 2024
@tshedor tshedor mentioned this issue Aug 30, 2024
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants