06 — Migrate participant, case, meeting and bias UI broadcasts to consumers
## Objective All remaining existing engine-backed presentation refreshes recover through the outbox, including operations corrections and nested lifecycle effects. ## Code locations app/services/voting_engine/{participant_updates_broadcaster,participant_view_state}.rb; app/controllers/secretary/{participants,cases,proposals}_controller.rb; app/controllers/proposals_controller.rb; app/controllers/admin/voting_operations_controller.rb; app/controllers/meetings_controller.rb; app/jobs/{start_case,end_meetings}_job.rb; app/controllers/api/cloud_router_callbacks_controller.rb; app/jobs/politician/meeting_manager_job.rb; app/models/{meeting,case,proposal}.rb. Reuse secretary/cases, secretary/ongoing_case, secretary/participants, secretary/speakers and politician partials. ## Changes - Extend existing ParticipantUpdatesBroadcaster/ParticipantViewState for lists, summary and affected director selectors; extract Secretary::ParticipantsController#broadcast_directors_dropdown_update rather than duplicate. Unexpected Conflict cannot be swallowed and recorded as a successful required delivery. - Extract Secretary::CasesController#broadcast_ongoing_case_update and #broadcast_case_list_updates to shared services; retain delegates for unrelated non-engine callers. Replace append/remove lifecycle combinations with current-state replacement where needed. - Move presentation after accepted case/meeting commands from StartCaseJob, end jobs and controllers. Preserve origin distinctions and nested poll/case refreshes; external effects themselves belong to provider/report tasks. - Move bias proposal registration/withdrawal/deletion publications; capture proposal/case/deleted poll IDs and eligible user cleanup audiences before destruction. Preserve per-user permissions and streams. Do not migrate unrelated ordinary proposal edits/notifications. - Remove Admin::VotingOperationsController#broadcast_correction direct effect/manual-refresh failure flow. Successful correction remains successful if delivery is temporarily unavailable; pending/failure is diagnosed through operations UI. - Refactor Politician::MeetingManagerJob broadcast logic into replay-safe consumer work. Preserve subscription establishment/refetch ordering without relying on a fragile untracked sleep+enqueue chain. Old queued jobs must remain compatible during drain. - Render with fresh committed state and explicit locals, municipality locale and no current_user/request/flash/modal assumptions. Confidential content refetches in authorized browser sessions; no shared decrypted HTML. Reuse shared ViewComponents for duplicated UI logic and existing partials for simple namespace-local markup. ## Acceptance and tests Proposed spec/services/voting_engine/outbox/state_presentation_spec.rb. Extend secretary participants/cases/proposals, general proposals, meetings, cloud-router callback and admin voting operations controller specs; start_case/end_meetings job specs. Assert HTTP responses unchanged but no direct publication, worker refreshes exact audiences, stale/deleted/archived contexts safe, modal excluded, locale/privacy preserved, no duplicates on replay and failure recorded. Run bundle exec rspec spec/controllers/secretary spec/controllers/proposals_controller_spec.rb spec/controllers/meetings_controller_spec.rb spec/controllers/api/cloud_router_callbacks_controller_spec.rb spec/controllers/admin/voting_operations_controller_spec.rb spec/jobs/start_case_job_spec.rb spec/jobs/end_meetings_job_spec.rb spec/services/voting_engine/outbox/state_presentation_spec.rb; RuboCop changed Ruby. ## Depends on https://task.matda.me/tasks/tsk_2qravp6n9b — complete routing. https://task.matda.me/tasks/tsk_beu5nmfqfj — worker/ledger. https://task.matda.me/tasks/tsk_5fdrm4pptn — callback ownership. Coordinate shared poll/participant effects with task 05. ## Questions None blocking. Preserve existing audiences and confidentiality rather than adding notifications or broadening access; non-voting meeting behavior is separately tracked in tsk_zxbg4uyua2.
Checklist
0 of 0 completeNo checklist items.
- Area
- Kaukus
- Kind
- Feature
- Priority
- Medium
- Task ID
tsk_anz44ptv7b- Updated