Skip to content

MOBILE-180: Trim operationsDomain config value before blank check#704

Merged
justSmK merged 1 commit into
developfrom
feature/MOBILE-180
May 14, 2026
Merged

MOBILE-180: Trim operationsDomain config value before blank check#704
justSmK merged 1 commit into
developfrom
feature/MOBILE-180

Conversation

@justSmK
Copy link
Copy Markdown
Collaborator

@justSmK justSmK commented May 14, 2026

Issue

Android trims before the blank check, so whitespace-only operations from JSON config clears stored and falls through to init → default.
iOS gated on isEmpty without trim, treated " " as invalid format,
and kept the previous value indefinitely. Bring iOS in line.

Android trims before the blank check, so whitespace-only operations
from JSON config clears stored and falls through to init → default.
iOS gated on isEmpty without trim, treated "   " as invalid format,
and kept the previous value indefinitely. Bring iOS in line.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Aligns iOS behavior with Android by trimming whitespace from the operationsDomain config value before the blank check in OperationsDomainConfigPolicy.action(for:currentlyStored:). Previously, whitespace-only strings were treated as a valid (but malformed) value, causing iOS to keep the previous stored value indefinitely instead of clearing it.

Changes:

  • Trim raw with .whitespacesAndNewlines before the empty check so whitespace-only inputs flow through the empty branch (clear or keep).
  • Add tests covering whitespace-only inputs (clear when stored, keep when nothing stored) and surrounding-whitespace trimming with canonicalization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Mindbox/InAppMessages/Configuration/Services/OperationsDomainConfigPolicy.swift Trim incoming raw value before the empty/blank guard.
MindboxTests/Network/OperationsURLRoutingTests.swift New tests for whitespace-only and surrounding-whitespace cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@justSmK justSmK merged commit ce1957b into develop May 14, 2026
8 checks passed
@justSmK justSmK deleted the feature/MOBILE-180 branch May 14, 2026 10:34
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.

4 participants