grassrootsgrocery / admin-portal

GNU Affero General Public License v3.0
10 stars 5 forks source link

Some event page summary stats are incorrect #64

Closed mattsahn closed 1 year ago

mattsahn commented 1 year ago

Looking at the summary stats for event pages, there are some incorrect numbers being displayed:

So, the logic for these counts needs to be checked and updated to correctly reflect counts.

image

alexkulkarni commented 1 year ago

So I've been poking around and I'm pretty sure this is a special events issue. If there are no special events, the test cases work fine. In events.ts, something weird is happening with the processgeneralevents numbers getting communicated to other parts of the code. Only started looking at this code this week, so someone else may know how those values are passed from one part of the code to another better.

mattsahn commented 1 year ago

@alexkulkarni, any more luck? Probably there is some wrong logic happening in the airtable formulas and/or in the app code and may be tied to presence of special groups. Are you able to reproduce with the test DB? Not sure if that one has this case or not.

alexkulkarni commented 1 year ago

is the test db on AIrtable? currently i can't make any edits on AIrtable and I don't know how to see the formulas to check

mattsahn commented 1 year ago

Let me see if I can find a reproducible example in the test DB. The edit and full view access to Airtable requires a paid account for you, which we can do if needed, but I think this particular one just needs a definite example in the test DB that shows up in the frontend and that should be enough to determine where the bug is.

mattsahn commented 1 year ago

@alexkulkarni, look at event for 2/11/2023 in the test DB (http://localhost:5173/events/recjBht3fOMKJe5z3)

image

The 2 metrics are wrong, which you can validate by playing with the filters in the volunteer table and can see what the real numbers should be.

You can look in client/src/pages/Events/Events.tsx and server/routes/events.ts for related code that powers that.

mattsahn commented 1 year ago

Resolved in #102