Skip to content

Use invariant formatting for received application properties - #104

Draft
niemyjski wants to merge 2 commits into
mainfrom
fix/invariant-received-properties
Draft

niemyjski wants to merge 2 commits into
mainfrom
fix/invariant-received-properties

Conversation

@niemyjski

@niemyjski niemyjski commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Received application-property values now use invariant formatting in both the message bus and queue entry. Numeric and date values previously changed representation with the receiver's culture. Existing strings stay unchanged, nulls remain omitted, and each boundary keeps its existing reserved-property filters. The original typed Service Bus properties remain intact for retries.

Validation: all 10 synthetic culture cases pass (all 10 failed before the correction); Release builds use published Foundatio 13.0.4 packages. Independent Astra review found no blockers. Both exact-head hosted builds passed on attempt one: 79 passed, 8 existing skips, 0 failed. Both package-publishing steps were skipped in each run. Local tests used no services; hosted integration tests used CI containers.

Compatibility: consumers of non-string application properties now receive invariant text, including dates under en-US. Consumers that previously parsed localized values should use invariant parsing. This does not alter already-string values or the underlying typed message.

Verification and implementation details
  • Covers both receive paths under en-US, de-DE, fr-FR, th-TH, and ar-SA, with literal expected decimal, double, and date strings.

  • Verifies null omission, empty/string preservation, case-insensitive diagnostic filtering, queue-only reserved headers, and preservation of original typed properties and attempt count.

  • Uses ServiceBusModelFactory, an in-memory queue, and a synthetic message-bus subclass that bypasses subscription setup and invokes the actual private receive callback. No client or processor is constructed.

  • Both conversions explicitly reject null before calling Convert.ToString(value, CultureInfo.InvariantCulture), preserving omission instead of producing an empty string.

  • Build: dotnet build Foundatio.AzureServiceBus.slnx --configuration Release -p:ReferenceFoundatioSource=false.

  • Focused tests: dotnet tests/Foundatio.AzureServiceBus.Tests/bin/Release/net10.0/Foundatio.AzureServiceBus.Tests.dll -class Foundatio.AzureServiceBus.Tests.ReceivedPropertyCultureTests.

  • .NET SDK 10.0.401/runtime 10.0.12; libraries built for net8.0/net10.0 and samples for net10.0.

  • Based on current main. No GroupId API, dependency, provider-setting, or transport changes. The build workflow is pinned to guarded core commit a28d0f736d9124431de09764c56aff77fbdc1d5d so feature-branch builds cannot publish packages. Full provider integration tests were not run locally; both hosted suites passed with eight existing skips.

  • Final head: d9d1b8847f69b2de48ea0e625e65bece5e6a02db. Push CI and PR CI both resolve the guarded workflow SHA above. Push packaging succeeded locally on the runner; publishing was skipped. PR packaging was also skipped.

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.

1 participant