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

Update statistics from backend more regularly #5977

Open
hmartink opened this issue Oct 20, 2024 · 7 comments
Open

Update statistics from backend more regularly #5977

hmartink opened this issue Oct 20, 2024 · 7 comments

Comments

@hmartink
Copy link

I'm DE based, but traveled to FR on 2024-10-08. I mapped using SC from the 8th to the 10th, when I returned to DE. On 2024-10-13 I traveled to NL and used SC until 2024-10-19. On 2024-10-18th (i.e. more than 7 days, but this is still the case today, 2024-10-20th) I looked at the 7 day statistics. There, the FR quests are still show. Similarly, the 7 day count on the main screen (when pressing the star), i.e. "last 7 days" also still includes the quest from FR in the overall number.

On the profile screen, the "7 day rank" for FR vanished this week (around 2024-10-15th), but so far no "7 days rank" for NL appeared. I met another mapper in NL and on his SC the "7 day rank" for NL was shown, both in the achievment screen as well as in the bar for the quest by country (when you tap on the NL flag) (I can report this as a different issue, if desired, but maybe this is related, hence I mention it here). The other mapper "only" traveled to NL, but not to FR (or any other country) beforehand.

Screenshot_20241018-163224_Street­Complete
Screenshot_20241018-163214_Street­Complete

How to Reproduce
Go to country A, use SC. Return to your main country and quickly (within the 7 day limit) go to country B. Start mapping. Observe the achievement screens after the return from country A + 7 days.

Expected Behavior
When 7 days elapsed, I expect the number in the * counter on the main screen to be reduced again (at least in the morning before solving new quests). Also in the achievement screens, I expect the flag (and count) from the first country (here: FR) to vanish 7 days after return from country A (here: FR).

Versions affected
SC 59.2
Android: 13, there was an update from /e/OS 1.20 to 2.4.1 during last week.

@hmartink hmartink added the bug label Oct 20, 2024
@westnordost
Copy link
Member

westnordost commented Oct 20, 2024

but so far no "7 days rank" for NL appeared

Not necessarily a bug, iirc the local rank is only displayed if you are amongst the top X.

Can you confirm that number of changes in France are still being displayed in the "last 7 days" view despite them having been solved more than 7 days ago? Were they also uploaded more than 7 days ago? What is your OSM username?

@westnordost westnordost added feedback required more info is needed, issue will be likely closed if it is not provided and removed bug labels Oct 20, 2024
@hmartink
Copy link
Author

For the NL rank: The other mapper did about the same as me (probably a little bit less), and he had a 7 days rank for NL.

As of now (2024-10-20, 15:19 UTC) the "last 7 days" ("Letzte 7 Tage" in German) is still shown, I left France on 2024-10-10.

I upload immediately, so yes, they were uploaded. (I just double checked, e.g. https://www.openstreetmap.org/node/5172479404, this was one of the last quests I solved).

My username is Helge Kreutzmannn.

@westnordost
Copy link
Member

I've looked at your statistics, they show up correctly from the server. For the last 7 days:

  • 1362 in NL
  • rank 5 in NL
  • rank 164 total

So it looks like for some reason, the app is not pulling the latest statistics.

The desired behavior is that it downloads it anew on

  • login
  • every application start, if the device is currently connected to the internet

Now, could as well be that your app has been not re-started for a very long time. It is really up to the Android system when the app is re-started. When sent in to the background, it is usually just "frozen". If you remove the app from recent activities and start the app again, that should count as a re-start of the app.

Would you do that to confirm if this is the source of the issue?

@hmartink
Copy link
Author

Ok, I did the following:
Pressed middle button on adroid, swiped SC upwards, and started it from the main screen again: Yes, now the statistics is correct.

(I'm not sure if I did this in the last two weeks).

@westnordost
Copy link
Member

Good, thanks.

Hmm, I am not sure if I want to change that behavior. Yes, it can lead to stale rank and last-7-days data, but what would be the alternative?

Querying the new statistics every time the user brings the app back to front? Too much.

Every time the user opens the profile screen? Uh, well, maybe?

@hmartink
Copy link
Author

As I'm not a real programmer, the only thing I could come up would be a some kind "last checked" stamp when opening the statistics page. If the "last checked" is from the previous day, the statistics would be fetched and the stamp updated. Otherwise the stamp would be left untouched.

If that is not possible/feasible, I can live with the current behavior, now that I know that I need to restart the app daily to get proper statistics (i.e. the old computer trick).

@westnordost westnordost added enhancement and removed feedback required more info is needed, issue will be likely closed if it is not provided labels Oct 20, 2024
@westnordost westnordost changed the title 7 day statistics are wrong Update statistics from backend more regularly Oct 20, 2024
@meiphoo7-Mae
Copy link

Good, thanks.

Hmm, I am not sure if I want to change that behavior. Yes, it can lead to stale rank and last-7-days data, but what would be the alternative?

Querying the new statistics every time the user brings the app back to front? Too much.

Every time the user opens the profile screen? Uh, well, maybe?

I don't suffer from this but ran into this accidentally.
I thought perhaps in addition to the options mentioned above is it a possibility to update the statistics when the user tries to download new quests? Searching for new quests is something every user has to do and it is an activity that is not performed every few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants