Closed btrautmann closed 9 months ago
Please see if https://github.com/teranetsrl/oauth2_client/pull/178 fixes these issues. If not, I am open for PRs
Thanks, I'll give that a shot and see if I see any new instances of the crash. If you prefer to close this and have me re-open if I have more crashes, feel free to do so!
You're welcome :) I think, I will leave this open for the time being. Maybe other people have the same problem and are jumping on the same bandwagon.
I can't say whether this was working (I think I had a regression after a while but not 100% sure), but unfortunately this did break my login functionality because of this PR (specifically the introduction of silentAuth
). It makes it so the JSON can't be deserialized. I had to revert the dependency override for now.
@rundfunk47 Have you made sure that the other approaches still work as expected? Probably the local storage approach is not functioning correctly anymore, could you check that please? Otherwise, I might have to disable your changes for now
@ThexXTURBOXx @btrautmann
If I understand this correctly, the issue is that silentAuth: json['silentAuth']
does not default to false
when deserialising, but crashes because there is no value? Or are you referring to another issue @ThexXTURBOXx ?
@btrautmann Is that the issue? I thought you were maybe referring to something else?
Sorry, I'm a little confused. Here's the series of events as I understand it:
oauth2_client
at https://github.com/ThexXTURBOXx/oauth2_client.git, which IIRC used a more recent version of flutter_web_auth2
dart pub upgrade
, which bumped flutter_web_auth_2
from 3.0.4
to 3.1.0
3.0.4
to 3.1.0
introduced a breaking change which broke my login flow (I found out after the app was already in production). See the image of the stacktrace below.Due to the above, I removed the dependency override as I wanted to fix the app in production. This resolved the issue (since I'm now using the older version of flutter_web_auth2
.
so I'm assuming changing:
FlutterWebAuth2Options.fromJson(Map<String, dynamic> json)
: this(
preferEphemeral: json['preferEphemeral'],
debugOrigin: json['debugOrigin'],
intentFlags: json['intentFlags'],
windowName: json['windowName'],
timeout: json['timeout'],
landingPageHtml: json['landingPageHtml'],
silentAuth: json['silentAuth'],
);
to
FlutterWebAuth2Options.fromJson(Map<String, dynamic> json)
: this(
preferEphemeral: json['preferEphemeral'],
debugOrigin: json['debugOrigin'],
intentFlags: json['intentFlags'],
windowName: json['windowName'],
timeout: json['timeout'],
landingPageHtml: json['landingPageHtml'],
silentAuth: json['silentAuth'] ?? false,
);
will likely fix the latter issue? I can create a PR for that 🙂
Yes, I suspect that will fix the issue :)
@rundfunk47 That should not be the problem as the preferEphemeral
bool works without any problems.
@btrautmann Could you please share any exceptions or logs? If that really is the problem, then there should be some exceptions
Maybe, this might be a fix anyway. I will try out soon!
I just uploaded 3.1.1, which should fix this issue. Please confirm whether this is the case @btrautmann
Could you please share any exceptions or logs? If that really is the problem, then there should be some exceptions
I posted the logs/Exception above. I'll give the new version a shot some time today.
Yes, sorry, I overlooked them at first, but found them afterwards. They are related to a problem I fixed once, but reintroduced with 3.1.0
Just checked, and yeah, that fixed it on both platforms 👍 Thank you for the quick turnaround!
Perfect, thank you very much for the feedback! :)
Description
I've had a few crashes reported with this package in the stacktrace:
In several of the reports, it seems a network request in the oauth flow has thrown a 404:
This package is being used transitively via
oauth2_client
3.2.2.Minimal Reproduction
oauth_client
^3.2.1Exception or Error
See description
Expected Behaviour
The package should gracefully handle network failures.
Screenshots
No response
Additional context
No response
Device
iPhone 14 Pro
OS
iOS 16.5.1
Browser
N/A
Flutter version
3.13.6
flutter_web_auth_2 version
2.2.1
Checklist