Bug report: Incorrectly indicated number of app users

I have a test database with many deleted app users from testing the Api:

select actors.type, actors."deletedAt" is null as active, count(id) from actors   
group by actors."type", actors."deletedAt" is null 

2020-10-20 10_59_50-pgAdmin 4

When I enter the page or refresh it, it shows the number of app users including the deleted ones:

2020-10-20 10_48_48-ODK Central

When I switch back to the page after selecting another, but without refreshing, the number of app users is correct - well, almost, I am missing one, but that may be some selection problem in the database

2020-10-20 10_49_18-ODK Central

I normally would report this technical error on github, but I was asked not to do this to keep github uncluttered)

1 Like

Thank you, @dmenne! This is great information.

I've created a GitHub issue for this: https://github.com/getodk/central-backend/issues/301. I realized that there's also a related issue with the form assignment endpoints: https://github.com/getodk/central-backend/issues/302.

Ah yes, interesting! Frontend gets information about the number of app users from two sources: from the appUsers property of the extended-metadata response from /v1/projects/:id and from /v1/projects/:id/app-users. It prefers the latter if it is available, but not all pages send that request, in which case the former is shown. The difference here emerges because /v1/projects/:id doesn't exclude deleted app users, but /v1/projects/:id/app-users does.

That's interesting. Let us know if you track down the reason for this missing one! (Could it be an app user from a deleted project?)