smrose / ActivistMirror

What kind of Activist are you? Answer a small set of questions to find out.
0 stars 0 forks source link

blank spaces in roles on session viewer #41

Open publicsphere opened 1 week ago

publicsphere commented 1 week ago

There are blank roles in several of the sessions. I thought this might be when I used the hypothetical set up tool bar but I'm not so sure. What's the answer? I can't see how there could be four patterns presented and no role?

smrose commented 1 week ago

I get that puzzlement, but there are certainly some sessions without associated roles. Consider the following query:

select s.session_id, count(*) as rcount from sessions s left join match_roles mr on s.session_id = mr.session_id group by session_id having rcount < 4;

What that puts in rcount is the number of rows from the join for which there aren't the expected four roles. And there are 27 such sessions, all from 13-15 November, and all created by developer 'doug'.

When a session is created, the next thing that's done is compute scores for each role and store them in match_roles. But if something goes wrong, the session is created before the match_roles rows are created.

The right way to deal with this is to use transactions to roll back the entirety if something goes wrong. That would take some time, though, and doesn't seem like the highest priority ATM. But I've already been reading about how to do it.