Skip to content

fix(dao): enforce strict DAO finalization — audit logs, close_date, and summary placement#466

Open
ayushshukla1807 wants to merge 3 commits intohatnote:masterfrom
ayushshukla1807:fix-finalize-round-dao-bypass
Open

fix(dao): enforce strict DAO finalization — audit logs, close_date, and summary placement#466
ayushshukla1807 wants to merge 3 commits intohatnote:masterfrom
ayushshukla1807:fix-finalize-round-dao-bypass

Conversation

@ayushshukla1807
Copy link
Copy Markdown

@ayushshukla1807 ayushshukla1807 commented Apr 3, 2026

Fixes #462.

The finalize_round endpoint was bypassing the standard DAO.close_round logic and mutating row state directly. This skipped writing the close_date and audit logs. I've routed it properly through the DAO so the lifecycle hooks trigger as expected.

@userAdityaa
Copy link
Copy Markdown

Hi @ayushshukla1807, apologies, but I’ve already opened a PR for this that also includes the additional tests covering the changes.

@ayushshukla1807
Copy link
Copy Markdown
Author

Hi @userAdityaa, excellent catch! I missed PR #463 while surveying the issue tracker! Closing this duplicate in favor of your implementation.

…sSummary to finalize_campaign

Per lgelauff's feedback on hatnote#462:
- finalize_ranking_round now only sets close_date, status, and writes audit log
- RoundResultsSummary creation moved to finalize_campaign, where it belongs
  (only created when the last round was a ranking round)
- finalize_round endpoint delegates to coord_dao.finalize_round()
@lgelauff
Copy link
Copy Markdown
Collaborator

You may also want to consider #491 here - there seems to be some overlap?

- Moved RoundResultsSummary creation from finalize_ranking_round to finalize_campaign as requested by maintainer.
- Created generic CoordinatorDAO.finalize_round method to ensure consistent status updates, close_date injection, and audit logging.
- Updated admin_endpoints.py to delegate to the new DAO method, resolving the bypass issue.
- Integrated regression test from PR hatnote#491 to ensure technical parity and future stability.
@ayushshukla1807
Copy link
Copy Markdown
Author

ayushshukla1807 commented Apr 12, 2026

Hey @lgelauff, good catch. I squashed the changes from #491 here and pulled the result summary stuff back into the controller layer so the DAO stays clean.

@ayushshukla1807 ayushshukla1807 changed the title Fix: Enforce strict DAO finalization logic to preserve audit logs and dates fix(dao): enforce strict DAO finalization — audit logs, close_date, and summary placement Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: finalize_round endpoint bypasses DAO finalization logic (missing close_date, audit log)

3 participants