Skip to content

[SDK-758] Lock the pre-init switch failure result - #1094

Merged
joaodordio merged 3 commits into
feature/SDK-674-switch-projectfrom
feature/SDK-758-preinit-failure-result
Oct 20, 2026
Merged

joaodordio merged 3 commits into
feature/SDK-674-switch-projectfrom
feature/SDK-758-preinit-failure-result

Conversation

@joaodordio

@joaodordio joaodordio commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

A switchProject before init reports switchedWithWarnings when start fails, and switchedCleanly when it succeeds.

🎟️ Jira Ticket: SDK-758

📖 Description

switchProject before initialization already forwarded start()'s result. This locks that in tests and in the changelog.

A failed start() (the first in-app sync is the usual cause) reports .switchedWithWarnings. A successful one reports .switchedCleanly. Android now reports the same two results. On Android the failure signal is a timeout or an exception from background initialization, not a failed in-app sync. Reasoning is on the Jira ticket.

Targets feature/SDK-674-switch-project. Independent of SDK-757. Android: Iterable/iterable-android-sdk#1101

🧪 How to test?

SwitchProjectGateTests:

  • testSwitchProjectBeforeInitializeReportsCleanlyWhenStartSucceeds
  • testSwitchProjectBeforeInitializeReportsWarningsWhenStartFails

🧾 Changelog

Updated the unreleased switchProject entry. A pre-init switch reports .switchedCleanly when start() succeeds and .switchedWithWarnings when it fails.

📹 Loom recording if applicable

N/A

🐞 Github Issues solved

None

📚 Docs PR if applicable

No docs PR. switchProject is not in iterable-docs yet. That write-up is SDK-676, and this result contract is noted there.

A switchProject before initialization reports switchedWithWarnings when start fails and switchedCleanly when it succeeds, the same two results Android now reports.
@joaodordio
joaodordio requested a review from a team as a code owner October 6, 2026 13:01
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.05%. Comparing base (0397a34) to head (f72974d).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           feature/SDK-674-switch-project    #1094   +/-   ##
===============================================================
  Coverage                           75.04%   75.05%           
===============================================================
  Files                                 118      118           
  Lines                               10621    10621           
===============================================================
+ Hits                                 7971     7972    +1     
+ Misses                               2650     2649    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rtlsilva rtlsilva 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.

No findings. LGTM

The result and callback docs said warnings only describe leaving the previous
project. Before initialization there is no previous project, and the result
reflects start() instead. On iOS the SDK is still initialized on the requested
project in that case, and a same-project retry is a no-op. The pre-init failure
test now locks in that retry behavior.
@joaodordio
joaodordio merged commit d28796e into feature/SDK-674-switch-project Oct 20, 2026
11 of 12 checks passed
@joaodordio
joaodordio deleted the feature/SDK-758-preinit-failure-result branch October 20, 2026 09:26
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.

2 participants