Skip to content

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

Open
joaodordio wants to merge 1 commit into
feature/SDK-674-switch-projectfrom
feature/SDK-758-preinit-failure-result
Open

joaodordio wants to merge 1 commit 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.11%. Comparing base (62412c6) to head (2f54900).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           feature/SDK-674-switch-project    #1094      +/-   ##
==================================================================
+ Coverage                           75.02%   75.11%   +0.09%     
==================================================================
  Files                                 118      118              
  Lines                               10618    10618              
==================================================================
+ Hits                                 7966     7976      +10     
+ Misses                               2652     2642      -10     

☔ 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.

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