Skip to content

Conversation

@martinothamar
Copy link
Contributor

@martinothamar martinothamar commented Jan 28, 2026

Description

Companion PR for Altinn/app-lib-dotnet#1645

Related Issue(s)

  • N/A

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • Bug Fixes
    • Improved trace data handling in PDF propagation with enhanced validation and error recovery. Added graceful fallback mechanism when data decoding encounters issues, ensuring more reliable trace propagation.

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

@martinothamar martinothamar self-assigned this Jan 28, 2026
@martinothamar martinothamar added kind/bug Something isn't working backport This PR should be cherry-picked onto older release branches labels Jan 28, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Enhances tracestate header handling in the PDF propagation module by adding base64 decoding logic. The code now attempts to decode the tracestate cookie value before transmission, with fallback to the original value and error logging if decoding fails.

Changes

Cohort / File(s) Summary
Tracestate base64 decoding enhancement
src/features/propagateTraceWhenPdf/index.ts
Added try-catch wrapped atob() decoding for tracestate cookie value with validation check for non-empty string; implements fallback to original value and error logging on decode failure

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing base64 decoding of the tracestate header in the PDF propagation path.
Description check ✅ Passed The description follows the required template structure with all major sections present, though most verification/QA checkboxes remain unchecked, which is acceptable for a companion PR addressing a specific bug fix.

✏️ 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/pdf-base64-decode-tracestate

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.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 45%)
0.0% Condition Coverage on New Code (required ≥ 45%)

See analysis details on SonarQube Cloud

@danielskovli
Copy link
Contributor

LGTM! Hvis du merger uten en approve her, får du kanskje #yolo badge 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR should be cherry-picked onto older release branches kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants