Skip to content

[SDK-757] Replay queued switch calls against the destination they were requested for - #1093

Open
joaodordio wants to merge 1 commit into
feature/SDK-674-switch-projectfrom
feature/SDK-757-route-queued-calls
Open

joaodordio wants to merge 1 commit into
feature/SDK-674-switch-projectfrom
feature/SDK-757-route-queued-calls

Conversation

@joaodordio

@joaodordio joaodordio commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

Replay queued switchProject calls against the destination they were requested for, not the switch that lands first.

🎟️ Jira Ticket: SDK-757

📖 Description

A call made after a later switchProject was requested was replayed into the switch already in flight.

ProjectSwitchGate now keeps each queued call with the switch leg that was the latest ask when the call was made. A drain only replays that leg. A call made from a switch callback still runs immediately against the project that just landed. Two asks for the same API key, with another destination between them, stay separate, so order is preserved within each destination.

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

🧪 How to test?

SwitchProjectGateTests:

  • testACallMadeAfterALaterDestinationWasRequestedWaitsForThatDestination
  • testFifoIsPreservedWithinEachDestinationAcrossAChain
  • existing gate tests, including identity set from a switch callback

🧾 Changelog

Updated the unreleased switchProject entry. A call made after a later destination has been requested is replayed against that destination.

📹 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 the queue contract is noted there.

…e requested for

A call made after a later switchProject was requested was replayed into the switch already in flight. Each queued call now stays with that destination, in order.
@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.10%. Comparing base (62412c6) to head (c4629d1).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           feature/SDK-674-switch-project    #1093      +/-   ##
==================================================================
+ Coverage                           75.02%   75.10%   +0.07%     
==================================================================
  Files                                 118      118              
  Lines                               10618    10631      +13     
==================================================================
+ Hits                                 7966     7984      +18     
+ Misses                               2652     2647       -5     

☔ 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