-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
fix: compile with webdev #653
Conversation
It sounds like dart2js support will not be possible without removing the use of How about we changing the |
It might be also pretty disruptive to drop support for uploading |
I think I was able to fix the issue 🎉 I created a stub for |
@@ -951,7 +951,7 @@ class GoTrueClient { | |||
notifyAllSubscribers(AuthChangeEvent.tokenRefreshed); | |||
_refreshTokenCompleter!.complete(authResponse); | |||
return authResponse; | |||
} on SocketException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about what is going on here. How can the thrown error type change without changing anything within the try block? Wouldn't .request()
call on line 942 still throw SocketException when there is an issue with the network?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the doc
If there is a socket-level failure when communicating with the server (for example, if the server could not be reached), IOClient will emit a ClientException that also implements SocketException. This allows callers to get more detailed exception information for socket-level failures, if desired.
So any SocketException from the HttpClient gets caught and put into a ClientException that also implements SocketException, so you can use both to catch the exception. See their send implementation.
I moved the commits now to the main branch, so we can ship this as well to v1. |
* feat: send messages via broadcast endpoint (#654) * feat: send messages via broadcast endpoint * chore: allow lower http version * fix: fixes and add tests * test: fix * fix: compile with webdev (#653) * chore(release): publish packages (#655) - realtime_client@1.3.0 - supabase@1.11.7 - supabase_flutter@1.10.20 * chore(release): publish packages (#656) - gotrue@1.12.3 - storage_client@1.5.3 - supabase@1.11.8 - supabase_flutter@1.10.21 * fix(gotrue): remove import of dart:io from gotrue_client.dart (#659) Remove import of dart:io from gotrue_client.dart * chore(release): publish packages (#663) - gotrue@1.12.4 - supabase@1.11.9 - supabase_flutter@1.10.22 * test: use ClientException * test: remove unused import --------- Co-authored-by: Tyler <18113850+dshukertjr@users.noreply.github.com> Co-authored-by: Kabo <20254485+kaboc@users.noreply.github.com>
Bug fix
What is the current behavior?
SocketException
, which in only thrown in native Dart, but not for example in dart2jsFile
fromdart:io
What is the new behavior?
ClientException
, which is also thrown in js runtime as documented hereFile
to be able to compile the package withwebdev
Additional context
This was meant to fix #641, but this would require the removal ofFile
, which im very unsure about. I think it makes things MUCH easier to be able to work withFile
on native platform, but somehow not being able to compile this to dart web is a bummer. I'm wondering why this package compiles for Flutter web though.close #641