MOBILE-180: Trim operationsDomain config value before blank check#704
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
rawwith.whitespacesAndNewlinesbefore 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.
Vailence
approved these changes
May 14, 2026
AndreyEmtsov
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.