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

libraries aren't sorted correctly in the latest pkg:googleapis #3744

Closed
kevmoo opened this issue Apr 11, 2024 · 1 comment
Closed

libraries aren't sorted correctly in the latest pkg:googleapis #3744

kevmoo opened this issue Apr 11, 2024 · 1 comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@kevmoo
Copy link
Member

kevmoo commented Apr 11, 2024

Compare the left library list in

https://pub.dev/documentation/googleapis/11.4.0/
https://pub.dev/documentation/googleapis/12.0.0/
https://pub.dev/documentation/googleapis/13.1.0/

The 13.1.0 are sorted incorrectly. I'm guessing it's due to the name being blank in all of these so we're just sorting on the hashcode, which ends up being...random?

/// Compares [a] with [b] by name.
int byName(Nameable a, Nameable b) {
var stringCompare = compareAsciiLowerCaseNatural(a.name, b.name);
if (stringCompare == 0) {
return a.hashCode.compareTo(b.hashCode);
}
return stringCompare;
}

@kevmoo kevmoo added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Apr 11, 2024
@srawlins srawlins added the P2 A bug or feature request we're likely to work on label Apr 11, 2024
@srawlins
Copy link
Member

srawlins commented Sep 4, 2024

I think I fixed this, but I don't know when. They looks sorted well in the latest docs.

@srawlins srawlins closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants