ApprovalQueue: use a materialized table #240

Merged
Oleg-Komarov merged 4 commits from approval-queue-fix into main 2024-08-23 15:11:46 +02:00

4 Commits

Author SHA1 Message Date
c0b3fb3d02 basic queue ordering test 2024-08-23 15:09:49 +02:00
f7d26d7298 sortkey doc 2024-08-23 14:15:10 +02:00
9362feb2dd fix signal logic 2024-08-23 14:03:50 +02:00
daad143fbe ApprovalQueue: use a materialized table
see #238

This change improves the listing performance: old code had to process all
ApprovalActivity to compute an extension's moderation status and position in
the queue.

Now we maintain a sortkey, a reference to the latest "meaningful" activity
object, and a total comment count. These fields are updated in a post_save
signal.

"Meaningful" activity means moderation status changes:
approved, awaiting changes, awaiting review.

"Non-meaningful" activity shouldn't affect queue position anymore and
extensions without "meaningful" activity should not appear in the queue, but
their respective detail pages should still be reachable via a direct link.
This UX may still need improvement, and #210 may be relevant here.
2024-08-23 13:32:14 +02:00