-
-
Notifications
You must be signed in to change notification settings - Fork 69
Int column turned to String in realtime listening (for one row) #68
Comments
Duplicate of #64. Also, could you not create another issue with the same information? |
@bdlukaa Sry accidentally sent it two times because i had duplicated the tab, won't happen again! |
But i am failing to understand how this is a duplicate, no one mentions int columns or whatever type being changed to String columns, I even have overridden my dependencies with that exact branch of Supabase before it was merged, because before that nothing worked and after the installing of that branch there were the issues with the String columns, so it is definitely not fixed |
I assumed the issue was with this. |
Here a small bit of code to maybe better understand the problem: create domain points as bigint check (value >= 0);
create domain color as smallint check ((value >= 0) and (value < 10));
create domain icon as smallint check ((value >= 0) and (value < 230));
create table public.profiles(
id uuid primary key references auth.users on delete cascade,
name varchar(8) not null check(name ~ '^(?!-|\s)([a-z-]|\s)*[a-z]$'),
status varchar(16) not null default 'im new to points',
bio varchar(256) not null,
color color not null default 9,
icon icon not null default 0,
points points not null default 0,
gives points not null default 0
); _client.from("profiles:id=eq.$userId").on(
SupabaseEventTypes.update,
(payload) {
final user = payload.newRecord!;
// TODO: Temp fix
if (user["color"] is String) {
user["color"] = int.parse(user["color"]);
}
if (user["icon"] is String) {
user["icon"] = int.parse(user["icon"]);
}
if (user["points"] is String) {
user["points"] = int.parse(user["points"]);
}
if (user["gives"] is String) {
user["gives"] = int.parse(user["gives"]);
}
// Now the user can actually be used
},
)
As you can see I have to convert each and every column (I put them in ifs checking the type incase Supabase changes again) |
@bdlukaa yes im sorry for not making it directly clear |
Bug report
Describe the bug
After getting the RealtimeSubscription Unhandled Exception: type 'Null' is not a subtype of type 'List' in type cast error and fixing it, im fed up again, if I get realtime data from my user profile (which is discriminated with the
:id=eq.$userId
) every column that is an int gets converted to a String in dart;To Reproduce
Pretty much said this, just need a table, and listen two only two one row, and all int columns won't be int in dart but a string
Expected behaviour
Obviously not have an error with the type conversion
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Please don't always roll out breaking changes, literally everything is breaking on this update.
The text was updated successfully, but these errors were encountered: