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

[CP] Fix dart pub login #49146

Closed
jonasfj opened this issue May 31, 2022 · 2 comments
Closed

[CP] Fix dart pub login #49146

jonasfj opened this issue May 31, 2022 · 2 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve

Comments

@jonasfj
Copy link
Member

jonasfj commented May 31, 2022

Commit(s) to merge

42e12a50de5371b4107ae1860945dcdf6ebb32fd (sdk/+/246582)

Target

stable

Issue Description

Fix dart pub login due to unexpected null in response.

What is the fix

The command crashed because the metadata end-point returned null for
the name property. This fix handles invalid responses more gracefully,
and handles the case where name is null, by not displaying the name.

Why cherry-pick

Users who was already logged was able to continue publish packages, but
displaying the login status using dart pub login was broken.
Attempts to login would also cause a crash after successful
authentication, before credentials were saved.

Risk

low (changes only affect the dart pub login command, which is fairly broken).

Issue link(s)

dart-lang/pub#3424

Extra Info

This bumps pub_rev with two new commits, see diff: dart-lang/pub@a949b32...cherry-pick-for-2.17.2

$ git log --format="%C(auto) %h %s" a949b329b1b51f5f3973a790e0a0a45897d837de..cherry-pick-for-2.17.2 
 c66381c5 Make `name` field of `_UserInfo` nullable. Fix #3424 (#3442)
 cecc8e3c Handle broken response from userinfo_endpoint (#3427)
@jonasfj jonasfj added the cherry-pick-review Issue that need cherry pick triage to approve label May 31, 2022
@jonasfj
Copy link
Member Author

jonasfj commented May 31, 2022

Update: I just realized that dart pub publish initiates a login-flow on-the-fly, and this flow does not talk to the meta-data end-point (hence, unaffected by this bug).

So users can still publish, even if they are not logged in, they just have to use dart pub publish and complete the login-flow it initiates.
But it's fair to think that some users who experience that dart pub login is broken, won't try to run dart pub publish -- since they'll think authentication is broken.

@vsmenon
Copy link
Member

vsmenon commented May 31, 2022

lgtm

@itsjustkevin itsjustkevin added the cherry-pick-approved Label for approved cherrypick request label May 31, 2022
@a-siva a-siva added the area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. label Jun 1, 2022
@athomas athomas closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve
Projects
None yet
Development

No branches or pull requests

7 participants