Skip to content

Conversation

@Ceredron
Copy link
Collaborator

@Ceredron Ceredron commented Nov 21, 2025

Description

It was permitted in A2 to confirm download before they were attempted to be downloaded. Therefore loosen up this validation for Legacy calls.

Related Issue(s)

  • #1546

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

    • Refined download confirmation validation for non-legacy workflows to require proper prior download state.
  • New Features

    • Event messages now include an alternative subject and use path-prefixed subjects when organization info is present.
    • Identifier URN-prefixing behavior removed to simplify identifier handling.
  • Tests

    • Added coverage validating differing confirmation behavior between legacy and modern workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

📝 Walkthrough

Walkthrough

Adds a non-legacy guard to download confirmation, a new test exercising legacy vs A3 confirmation behavior, removes a string URN-prefix helper, and changes CloudEvent subject handling by introducing an AlternativeSubject and path-prefixed Subject construction.

Changes

Cohort / File(s) Summary
Download confirmation logic
src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
Adds a conditional check: when request.IsLegacy is false, requires at least one RecipientCurrentStatuses entry with Status == DownloadStarted; otherwise returns ConfirmDownloadBeforeDownloadStarted. Legacy path unchanged.
Tests (legacy vs A3 confirmation)
tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
Adds test ConfirmNotDownloadedFile_PermittedInLegacyNotInA3 verifying A3 confirm returns BadRequest while legacy confirm succeeds and final statuses progress to DownloadConfirmed / AllConfirmedDownloaded.
String utilities
src/Altinn.Broker.Common/StringExtensions.cs
Removes public extension method WithUrnPrefix(this string identifier) and its using of constants, eliminating URN-prefixing behavior and associated validation.
Altinn event subject handling
src/Altinn.Broker.Integrations/Altinn/Events/AltinnEventBus.cs
Changes CloudEvent Subject assignment to a path-prefixed value "/organisation/{org}" when organizationNumber present (otherwise null); introduces AlternativeSubject set to "/party/{partyId}" when partyId present.
CloudEvent model
src/Altinn.Broker.Integrations/Altinn/Events/CloudEvent.cs
Adds new nullable public property AlternativeSubject (public string? AlternativeSubject { get; set; }).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to the guard condition in ConfirmDownloadHandler.cs to ensure correct evaluation of IsLegacy and status entries.
  • Review the new test for completeness and potential race/timing assumptions around status transitions.
  • Verify callers/consumers of CloudEvent.Subject handle the changed format and the new AlternativeSubject property.
  • Confirm removal of WithUrnPrefix does not leave usages elsewhere or change external string formats unexpectedly.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: disabling ConfirmDownload validation for Legacy calls to support A2 compatibility. It is concise, specific, and clearly summarizes the primary objective of the changeset.
Description check ✅ Passed The PR description provides clear context about the change, includes the related issue #1546, and has all required verification checkboxes completed. It explains the business rationale (A2 compatibility) for loosening validation.
✨ 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/disable-confirm-check-for-legacy

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.

@Ceredron Ceredron marked this pull request as ready for review November 21, 2025 10:27
@Ceredron Ceredron added the kind/bug Something isn't working label Nov 21, 2025
@Ceredron Ceredron changed the title Disable validation for legacy calls for compatibility with A2 Disable some ConfirmDownload validation for compatibility with A2 Nov 21, 2025
Copy link
Collaborator

@RagnarFatland RagnarFatland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice and simple.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs (1)

638-661: LGTM! Test effectively validates legacy vs. A3 behavior.

The test correctly verifies that the A3 endpoint rejects confirmation without a prior download (BadRequest), while the legacy endpoint allows it for backward compatibility. The assertions confirm the expected status transitions.

Minor cleanup: The uploadedFileLength variable on line 647 is assigned but never used in the test.

Apply this diff if you'd like to remove it:

-        var uploadedFileLength = await UploadZipFile(fileTransferId);
+        await UploadZipFile(fileTransferId);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 733f76d and bcecdad.

📒 Files selected for processing (2)
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs (1 hunks)
  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs:239-249
Timestamp: 2024-10-29T12:15:40.824Z
Learning: In the `ManifestDownloadStream` class (`src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs`), ZIP file validation is performed later in the code within the `AddManifestFile` method, so enhancing the `IsZipFile` method is unnecessary.
📚 Learning: 2024-10-29T12:51:11.540Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/ManifestDownloadStreamTests.cs:24-39
Timestamp: 2024-10-29T12:51:11.540Z
Learning: In `tests/Altinn.Broker.Tests/ManifestDownloadStreamTests.cs`, refactoring suggestions aimed at enhancing test organization and coverage may be considered less readable and of dubious value.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
📚 Learning: 2024-10-29T12:50:05.699Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs:18-28
Timestamp: 2024-10-29T12:50:05.699Z
Learning: In `tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs`, the test code is static and will not change, so refactoring suggestions on this file are unnecessary.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
📚 Learning: 2024-10-29T12:12:50.346Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/Factories/FileTransferEntityFactory.cs:8-45
Timestamp: 2024-10-29T12:12:50.346Z
Learning: When suggesting code improvements in `tests/Altinn.Broker.Tests/Factories/FileTransferEntityFactory.cs`, avoid adding excessive comments and unnecessary code changes.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
📚 Learning: 2024-10-29T12:15:40.824Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs:239-249
Timestamp: 2024-10-29T12:15:40.824Z
Learning: In the `ManifestDownloadStream` class (`src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs`), ZIP file validation is performed later in the code within the `AddManifestFile` method, so enhancing the `IsZipFile` method is unnecessary.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
📚 Learning: 2024-11-14T07:00:48.796Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 582
File: tests/Altinn.Broker.Tests.LargeFile/Program.cs:80-82
Timestamp: 2024-11-14T07:00:48.796Z
Learning: In test programs like `tests/Altinn.Broker.Tests.LargeFile/Program.cs` in the `Altinn.Broker` project, it's acceptable to proceed without checking the success of HTTP responses or adding additional error handling.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
📚 Learning: 2024-10-29T10:43:16.160Z
Learnt from: Andreass2
Repo: Altinn/altinn-broker PR: 561
File: src/Altinn.Broker.API/Controllers/LegacyFileController.cs:80-81
Timestamp: 2024-10-29T10:43:16.160Z
Learning: In the Altinn Broker API, specifically in `src/Altinn.Broker.API/Controllers/LegacyFileController.cs`, when handling file uploads in the `UploadFileStreamed` method, we can assume that all uploaded files are small and that the `Content-Length` header is always provided. Therefore, additional error handling for missing `Content-Length` is not required.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
📚 Learning: 2024-10-29T12:45:23.330Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs:199-237
Timestamp: 2024-10-29T12:45:23.330Z
Learning: In the `ManifestDownloadStream` class (`src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs`), optimizing memory usage in `AddManifestFile` by modifying the ZIP archive without loading the entire content into memory is currently not feasible because the base stream is a `ReadOnlyMemoryStream` based on a download stream. This optimization will be evaluated when the download stream is re-written in the "Support bigger files"-PR.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
📚 Learning: 2024-11-14T07:01:04.663Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 582
File: tests/Altinn.Broker.Tests.LargeFile/Program.cs:147-147
Timestamp: 2024-11-14T07:01:04.663Z
Learning: In the project `Altinn.Broker.Tests.LargeFile`, the codebase uses C# 12 features like collection expressions, such as initializing collections with `PropertyList = []`. Do not flag this syntax as invalid in future reviews.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
📚 Learning: 2024-10-29T12:49:46.020Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs:34-43
Timestamp: 2024-10-29T12:49:46.020Z
Learning: In test code (e.g., 'tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs'), prefer simplicity ('KISS') over optimizations like caching instances.

Applied to files:

  • tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs
📚 Learning: 2024-10-29T11:25:42.867Z
Learnt from: Andreass2
Repo: Altinn/altinn-broker PR: 560
File: src/Altinn.Broker.Application/DownloadFile/DownloadFileHandler.cs:49-55
Timestamp: 2024-10-29T11:25:42.867Z
Learning: In `DownloadFileHandler` in `src/Altinn.Broker.Application/DownloadFile/DownloadFileHandler.cs`, due to the 1 GB file size limit, loading the entire file into memory is acceptable in this context.

Applied to files:

  • src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs
🧬 Code graph analysis (2)
tests/Altinn.Broker.Tests/LegacyFileControllerTests.cs (4)
tests/Altinn.Broker.Tests/FileTransferControllerTests.cs (15)
  • Fact (53-64)
  • Fact (66-80)
  • Fact (82-94)
  • Fact (95-110)
  • Fact (112-127)
  • Fact (129-171)
  • Fact (173-231)
  • Fact (233-256)
  • Fact (258-271)
  • Fact (273-286)
  • Fact (288-316)
  • Fact (318-335)
  • Task (894-903)
  • Task (905-914)
  • Task (915-922)
tests/Altinn.Broker.Tests/Factories/FileTransferInitializeExtTestFactory.cs (1)
  • FileTransferInitializeExtTestFactory (5-43)
src/Altinn.Broker.API/Models/FileTransferInitializeResponseExt.cs (1)
  • FileTransferInitializeResponseExt (6-12)
src/Altinn.Broker.API/Mappers/LegacyFileStatusOverviewExtMapper.cs (3)
  • LegacyFileOverviewExt (17-36)
  • LegacyRecipientFileStatusExt (124-133)
  • LegacyFileStatusExt (38-52)
src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs (1)
src/Altinn.Broker.API/Mappers/LegacyFileStatusOverviewExtMapper.cs (1)
  • ActorFileTransferStatus (75-89)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (1)
src/Altinn.Broker.Application/ConfirmDownload/ConfirmDownloadHandler.cs (1)

69-73: LGTM! Legacy/A3 behavioral split implemented correctly.

The conditional guard correctly implements the requirement: non-legacy (A3) requests now enforce that DownloadStarted must occur before DownloadConfirmed, while legacy requests bypass this validation for Altinn 2 compatibility.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/Altinn.Broker.Integrations/Altinn/Events/CloudEvent.cs (1)

12-12: Consider adding XML documentation for the new AlternativeSubject property.

The new AlternativeSubject property would benefit from XML documentation explaining its purpose, when it's populated, and how it differs from the Subject property. This would help event consumers understand the dual-subject approach introduced for A2 compatibility.

Example documentation:

+    /// <summary>
+    /// Gets or sets an alternative subject for the event, typically containing the party ID path when available.
+    /// Used alongside Subject to support both organization number and party ID based event routing.
+    /// </summary>
     public string? AlternativeSubject { get; set; }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcecdad and 536ac94.

📒 Files selected for processing (3)
  • src/Altinn.Broker.Common/StringExtensions.cs (1 hunks)
  • src/Altinn.Broker.Integrations/Altinn/Events/AltinnEventBus.cs (1 hunks)
  • src/Altinn.Broker.Integrations/Altinn/Events/CloudEvent.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs:239-249
Timestamp: 2024-10-29T12:15:40.824Z
Learning: In the `ManifestDownloadStream` class (`src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs`), ZIP file validation is performed later in the code within the `AddManifestFile` method, so enhancing the `IsZipFile` method is unnecessary.
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs:199-237
Timestamp: 2024-10-29T12:45:23.330Z
Learning: In the `ManifestDownloadStream` class (`src/Altinn.Broker.Core/Helpers/ManifestDownloadStream.cs`), optimizing memory usage in `AddManifestFile` by modifying the ZIP archive without loading the entire content into memory is currently not feasible because the base stream is a `ReadOnlyMemoryStream` based on a download stream. This optimization will be evaluated when the download stream is re-written in the "Support bigger files"-PR.
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/ManifestDownloadStreamTests.cs:24-39
Timestamp: 2024-10-29T12:51:11.540Z
Learning: In `tests/Altinn.Broker.Tests/ManifestDownloadStreamTests.cs`, refactoring suggestions aimed at enhancing test organization and coverage may be considered less readable and of dubious value.
Learnt from: Andreass2
Repo: Altinn/altinn-broker PR: 561
File: src/Altinn.Broker.API/Controllers/LegacyFileController.cs:80-81
Timestamp: 2024-10-29T10:43:16.160Z
Learning: In the Altinn Broker API, specifically in `src/Altinn.Broker.API/Controllers/LegacyFileController.cs`, when handling file uploads in the `UploadFileStreamed` method, we can assume that all uploaded files are small and that the `Content-Length` header is always provided. Therefore, additional error handling for missing `Content-Length` is not required.
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs:18-28
Timestamp: 2024-10-29T12:50:05.699Z
Learning: In `tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs`, the test code is static and will not change, so refactoring suggestions on this file are unnecessary.
📚 Learning: 2024-10-23T12:43:47.413Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 552
File: src/Altinn.Broker.API/Helpers/AltinnTokenEventsHelper.cs:11-22
Timestamp: 2024-10-23T12:43:47.413Z
Learning: In the Altinn Broker API, when handling authentication failures in `AltinnTokenEventsHelper.OnAuthenticationFailed`, issuer values are case-sensitive, so issuer comparisons should be case-sensitive.

Applied to files:

  • src/Altinn.Broker.Integrations/Altinn/Events/AltinnEventBus.cs
  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-12-08T23:15:58.682Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 610
File: src/Altinn.Broker.Core/StringExtensions.cs:0-0
Timestamp: 2024-12-08T23:15:58.682Z
Learning: In `src/Altinn.Broker.Core/StringExtensions.cs`, prefer keeping the `WithoutPrefix` method simple and readable, avoiding complex modifications that reduce readability.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-12-08T22:55:30.559Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 610
File: src/Altinn.Broker.Common/StringExtensions.cs:23-30
Timestamp: 2024-12-08T22:55:30.559Z
Learning: In `src/Altinn.Broker.Common/StringExtensions.cs`, the `WithoutPrefix` method in the C# project checks if `orgNumber` is null or whitespace and returns an empty string if it is. Therefore, calling `orgNumber.Split(':').Last()` is safe, as the method ensures `orgNumber` is non-empty before splitting.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-10-29T12:12:50.346Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/Factories/FileTransferEntityFactory.cs:8-45
Timestamp: 2024-10-29T12:12:50.346Z
Learning: When suggesting code improvements in `tests/Altinn.Broker.Tests/Factories/FileTransferEntityFactory.cs`, avoid adding excessive comments and unnecessary code changes.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-10-29T12:50:05.699Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs:18-28
Timestamp: 2024-10-29T12:50:05.699Z
Learning: In `tests/Altinn.Broker.Tests/Helpers/ManifestDownloadStreamHelpers.cs`, the test code is static and will not change, so refactoring suggestions on this file are unnecessary.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-11-27T14:04:55.778Z
Learnt from: RagnarFatland-Avanade
Repo: Altinn/altinn-broker PR: 593
File: src/Altinn.Broker.Application/ExpireFileTransfer/ExpireFileTransferHandler.cs:96-96
Timestamp: 2024-11-27T14:04:55.778Z
Learning: In the Altinn Broker codebase, when throwing exceptions in C# code, prefer to use generic exceptions rather than creating custom exception classes, aiming to keep the code simple.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-11-14T07:12:14.214Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 582
File: src/Altinn.Broker.Persistence/Repositories/FileTransferRepository.cs:176-177
Timestamp: 2024-11-14T07:12:14.214Z
Learning: In `src/Altinn.Broker.Persistence/Repositories/FileTransferRepository.cs`, avoid suggesting to extract inline SQL queries into constants.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-10-29T12:51:11.540Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 560
File: tests/Altinn.Broker.Tests/ManifestDownloadStreamTests.cs:24-39
Timestamp: 2024-10-29T12:51:11.540Z
Learning: In `tests/Altinn.Broker.Tests/ManifestDownloadStreamTests.cs`, refactoring suggestions aimed at enhancing test organization and coverage may be considered less readable and of dubious value.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-11-14T07:00:59.444Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 582
File: src/Altinn.Broker.Core/Domain/ServiceOwnerEntity.cs:11-21
Timestamp: 2024-11-14T07:00:59.444Z
Learning: In the Altinn.Broker project, exceptions should not be used for control flow or logic; prefer returning null or appropriate results instead.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
📚 Learning: 2024-11-14T07:00:48.796Z
Learnt from: Ceredron
Repo: Altinn/altinn-broker PR: 582
File: tests/Altinn.Broker.Tests.LargeFile/Program.cs:80-82
Timestamp: 2024-11-14T07:00:48.796Z
Learning: In test programs like `tests/Altinn.Broker.Tests.LargeFile/Program.cs` in the `Altinn.Broker` project, it's acceptable to proceed without checking the success of HTTP responses or adding additional error handling.

Applied to files:

  • src/Altinn.Broker.Common/StringExtensions.cs
🔇 Additional comments (2)
src/Altinn.Broker.Common/StringExtensions.cs (1)

1-114: LGTM! Dead code removal verified as safe and complete.

Verification confirms that WithUrnPrefix has no remaining references in the codebase, and the removal of the Altinn.Broker.Common.Constants using directive from StringExtensions.cs is appropriate. The Constants namespace remains correctly imported in other files that require it. The WithoutPrefix() method is properly retained and continues to be used throughout the codebase.

src/Altinn.Broker.Integrations/Altinn/Events/AltinnEventBus.cs (1)

96-97: Review comment is incorrect and should be disregarded.

Based on git history, the current code (lines 96-97) is reverting a one-day-old experimental change. Commit 733f76d attempted to switch Subject to URN format and remove AlternativeSubject, but commit 536ac94 (merged today) reverted that change, restoring the original path format (/organisation/ and /party/) with both Subject and AlternativeSubject fields. This is not a breaking change being introduced—it's a revert to the established format. Event consumers are not impacted by a format migration; the code is restoring the previous working format.

Likely an incorrect or invalid review comment.

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.

2 participants