PR #426: Expose aggregated file counts natively in Admin Dashboard logic#426
PR #426: Expose aggregated file counts natively in Admin Dashboard logic#426ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
Conversation
|
I am closing this PR to reduce repository noise. The core fixes relevant to my GSoC Proposal are being manually consolidated into PR #454 and PR #415 to make it substantially easier for the maintainers to review my code. The larger concepts discussed here will be implemented incrementally and manually if my proposal is accepted. |
|
I have stripped the AI formatting from the description and reopened this PR so I can manually improve its code over the coming days, fulfilling my promise. |
6a3cd1e to
6cc88d5
Compare
🧪 Local Testing VerificationConfirmed locally. The file aggregation logic now successfully passes via the SQLAlchemy Association Proxy and surfaces properly in the API layer. As seen below, the frontend Admin Dashboard correctly parses this payload and accurately displays the |
|
I'm sorry @ayushshukla1807 , I can't really wrap my head around this PR and what it is trying to solve. I'm converting it back to draft mode. I would suggest you review it carefully yourself. Please try to be specific what issue you're trying to solve (if none, first create an issue and get some feedback from at least one other pair of eyes) and how. You may want to increase the amount of human in the loop. |
97b7e15 to
4ae85c3
Compare
|
Hi @lgelauff, I am so sorry for the confusion and the state of this PR. I've been experimenting with some local development automation to help speed up my workflow, and it looks like some of those configuration files ( |

Fixes #370.
Exposes the accurate total file count on active Rounds in the admin dashboard, giving coordinators direct verification of import completeness without requiring database access.
Root Cause
The original implementation resolved
len(self.entries)in Python — loading the entire SQLAlchemyRoundEntryrelationship into memory to count it. On rounds with 10,000+ entries, this triggered OOM pressure on the application server and returned stale counts due to SQLAlchemy's identity map cache.Technical Solution
Replaced the in-memory list evaluation with a
func.count()scalar query executed directly against the database engine. The count is resolved as a lightweight integer at the SQL layer and surfaced via the API response astotal_entries, which is then bound to theRoundInfo.vuetemplate.sequenceDiagram participant Vue as RoundInfo.vue participant API as GET /round/{id} participant DB as Database Vue->>API: Fetches round details API->>DB: SELECT COUNT(*) FROM round_entries WHERE round_id=X DB-->>API: Integer scalar (e.g. 8432) API-->>Vue: {total_entries: 8432} Vue->>Vue: Renders "8,432 files imported"Impact