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

No -1 in the world after log-in #5141

Closed
DoggoOfSpeed opened this issue Jul 14, 2023 · 7 comments · Fixed by #5147
Closed

No -1 in the world after log-in #5141

DoggoOfSpeed opened this issue Jul 14, 2023 · 7 comments · Fixed by #5147
Labels
feedback required more info is needed, issue will be likely closed if it is not provided

Comments

@DoggoOfSpeed
Copy link

image

I changed the username, password and email address of my osm account and after logging in with the new info the app claims that I'm number -1 in the world (which is a pretty bad place to be imo)

How to Reproduce
Change your OSM profile so that you have to renew your StreetComplete log-in.

Log-in to street complete

Expected Behavior
I am placed where I should be

Versions affected
53.2

@westnordost
Copy link
Member

Well, you are even in front of the first guy, you are so lucky! ;-)

@westnordost
Copy link
Member

What is your OSM username?

@westnordost westnordost added the feedback required more info is needed, issue will be likely closed if it is not provided label Jul 14, 2023
@westnordost
Copy link
Member

How to Reproduce
Change your OSM profile so that you have to renew your StreetComplete log-in.
Log-in to street complete

Cannot reproduce.

@DoggoOfSpeed
Copy link
Author

Hmm... After some time it has gone normal. Should I close the issue?

@westnordost
Copy link
Member

westnordost commented Jul 14, 2023

So, the rank can be -1 if not determined yet (server-side) and also not set yet locally. And this rank is unconditionally written into the text field.

However, the item is made invisible if the rank <= 0. So, I have no idea how this is possible. Maybe something to do with animations (being off on your device?), but I just checked that too, still not reproducible.

So at the moment I just assume it is some bug in the Android API on the distribution used on your particular device 🤷 and I do not really want to implement workarounds for such assumptions, so I'd indeed close this. If this happens for other people too, it could be revisited.

For the record, what's your Android version and device name?

@westnordost westnordost closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
@tapetis
Copy link
Contributor

tapetis commented Jul 15, 2023

I also had this happen to me once. It is likely related to an animation running on the text view when the local stats with rank -1 are displayed after login, while at the same time new stats are retrieved from the server with a rank > 0 that make the surrounding container visible again. As the previousRank is not cleared on logout, an animation is started even when the local rank is -1, but the next update is not animated as previousRank <= 0 is true in this case. The animation to value -1 may thus complete after the text view was set to display the correct rank.

In the following code snippet, it is therefore probably best not to execute the code after the isGone call at all, unless the container is actually visible.

container.isGone = rank <= 0 || statisticsSource.getEditCount() <= 100
val updateRank = { r: Int ->
circle.text = "#$r"
circle.background.level = getScaledGlobalRank(r)
}
if (previousRank <= 0 || previousRank < rank) {
updateRank(rank)
} else {
animate(previousRank, rank, container, updateRank)
}

@DoggoOfSpeed
Copy link
Author

DoggoOfSpeed commented Jul 15, 2023

For the record, what's your Android version and device name?

Android 11, Samsung Galaxy S6 and my OSM nickname is leekleak (also, sorry for the late reply 😓)
(oh, and -1 is a pretty bad place to be because in python the index -1 refers to the last element of the array)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback required more info is needed, issue will be likely closed if it is not provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants