Skip to content

Comments

Fix Party not being set in Dialog for Synced Read and Confirm events#1721

Merged
RagnarFatland merged 3 commits intomainfrom
fix/syncPartyForReadConfirm
Feb 10, 2026
Merged

Fix Party not being set in Dialog for Synced Read and Confirm events#1721
RagnarFatland merged 3 commits intomainfrom
fix/syncPartyForReadConfirm

Conversation

@RagnarFatland
Copy link
Collaborator

@RagnarFatland RagnarFatland commented Feb 4, 2026

Updated SyncCorrespondenceStatusEventsHandler to send partyurn/actorid to Dialgporten when creating InformationActivities for both Read and Confirmed.

Since this was not sent earlier, this could lead to cases where it is incorrectly reported that the recipient performed the action, when it could be other people or end user systems.

Description

Also added unit tests and data to validate behavior.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green
  • If pre- or post-deploy actions (including database migrations) are needed, add a description, include a "Pre/Post-deploy actions" section below, and mark the PR title with ⚠️

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced correspondence status synchronization with runtime validation guards for user mappings. System now properly logs warnings and skips updates when end-user mapping data is unavailable.
  • Tests

    • Expanded test coverage for multi-user scenarios and status event processing, including Read and Confirmed status handling with proper user association validation.

…ogporten when creating InformationActivities for both Read and Confirmed.

Since this was not sent earlier, this could lead to cases where it is incorrectly reported that the recipient performed the action, when it could be other people og end user systems.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The pull request introduces multi-user testing support by adding a second test user to the Altinn Register test service, refactoring test cases to validate party URN handling in Dialogporten activity enqueuing, and adding runtime guards in the production handler to verify end-user mappings before processing status events.

Changes

Cohort / File(s) Summary
Test Whitespace
Test/Altinn.Correspondence.Tests/TestingController/Migration/SyncCorrespondenceStatusEventTests.cs
Trailing whitespace on field declaration (no functional change).
SyncCorrespondenceStatusEvent Handler Tests
Test/Altinn.Correspondence.Tests/TestingHandler/SyncCorrespondenceStatusEventHandlerTests.cs
Added second user test data and mocks for multi-user scenarios; refactored helper methods to accept and validate party URN parameters; updated test assertions to verify correct party URN in Dialogporten Enqueued jobs; renamed test to reflect alternative user flow.
SyncCorrespondenceStatusEvent Production Handler
src/Altinn.Correspondence.Application/SyncCorrespondenceEvent/SyncCorrespondenceStatusEventHandler.cs
Added runtime guards requiring valid endUserId mapping before enqueueing CreateConfirmedActivity and CreateOpenedActivity; extended GetDialogPortenEndUserIdsForEvents to include Read and Confirmed statuses; logs warnings on missing end-user mappings.
Altinn Register Test Service
src/Altinn.Correspondence.Integrations/Altinn/Register/AltinnRegisterDevService.cs
Introduced second test user (ID 200) with corresponding UUID; extended LookUpPartyById and LookUpPartyByPartyUuid methods to return complete party details for the second user.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing Party not being set in Dialog for Synced Read and Confirm events, which aligns with the handler logic updates and new test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description adequately covers the change purpose, includes a related issue reference, and all verification checkboxes are marked as completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/syncPartyForReadConfirm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RagnarFatland RagnarFatland added the kind/bug Something isn't working label Feb 4, 2026
@RagnarFatland RagnarFatland merged commit b89f12c into main Feb 10, 2026
6 checks passed
@RagnarFatland RagnarFatland deleted the fix/syncPartyForReadConfirm branch February 10, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants