Skip to content

fix(ad-hoc): honour ephemeral web authentication session preference - #551

Merged
andrii-vysotskyi-cko merged 2 commits into
masterfrom
fix/ephemeral-session-and-telemetry-name
Nov 11, 2026
Merged

andrii-vysotskyi-cko merged 2 commits into
masterfrom
fix/ephemeral-session-and-telemetry-name

Conversation

@andrii-vysotskyi-cko

Copy link
Copy Markdown
Collaborator

Description

  • prefersEphemeralWebAuthenticationSession: false was dropped when the invoice authorization request was rebuilt.
  • Customer token assignment always used an ephemeral session and dropped localeIdentifier after a customer action.
  • Telemetry sent the app version as the app name.

Solution

  • Forward the missing fields in both replacing helpers.
  • Add prefersEphemeralWebAuthenticationSession to POAssignCustomerTokenRequest (defaults to true).
  • Send applicationName as the telemetry app name.

Forward prefersEphemeralWebAuthenticationSession when rebuilding invoice
authorization and customer token assignment requests, so it no longer
falls back to the default value. Also preserve localeIdentifier when
rebuilding customer token assignment requests.

Expose prefersEphemeralWebAuthenticationSession on
POAssignCustomerTokenRequest instead of always using an ephemeral session.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new nonoptional CodingKeys entry breaks decoding of previously valid request JSON when the field is absent; decoding must default it to true while keeping it excluded from encoding.

1 open issue
What changed in this PR

This PR preserves web authentication preferences across invoice authorization and customer token assignment, and corrects the application name reported in telemetry.

Changes:

  • Forward the ephemeral-session preference when rebuilding requests and handling customer actions.
  • Add a customer token session preference defaulting to true, and preserve the locale when rebuilding requests.
  • Use applicationName rather than applicationVersion for the telemetry app name.
File Description
Sources/​ProcessOut/​Sources/​Services/​Telemetry/​DefaultTelemetryService.swift Corrects the telemetry application name.
Sources/​ProcessOut/​Sources/​Services/​Invoices/​DefaultInvoicesService.swift Preserves the session preference in rebuilt requests.
Sources/​ProcessOut/​Sources/​Services/​CustomerTokens/​DefaultCustomerTokensService.swift Uses the session preference and preserves it alongside the locale.
Sources/​ProcessOut/​Sources/​Repositories/​CustomerTokens/​Requests/​POAssignCustomerTokenRequest.swift Adds the public session preference with a default of true.
Sources/​ProcessOut/​Sources/​Generated/​Sourcery+Generated.swift Adds the preference to generated coding keys.

Review effort: Balanced

@andrii-vysotskyi-cko
andrii-vysotskyi-cko merged commit ee9d9d9 into master Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants