Repository navigation
MOBILE-458: Fetch segmentations and geo before a page asks about its in-apps - #796
Merged
Merged
Conversation
added 2 commits
October 7, 2026 15:51
…in-apps The stories page waits 3 s for filterShowableInapps, and the segmentations of its circles were fetched lazily on that question, so a slow CheckCustomerSegments made the page give up and the whole ribbon collapse. Like iOS, the place resolve now fetches the session's segmentations and geo in parallel before handing the content over (only when the place has candidates), and a web-page overlay does the same after APP_STARTED is released. The page is answered from the session cache. - Segmentation and geo repositories cache a failed fetch for the session, so the page path no longer re-hits the network for every circle and question. - The page's question goes through matchesRequestedTargeting, the place check without failure reporting.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Parse failures bypass session caching, and the PR includes an unrelated animation behavior change.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Prefetches geo and segmentation data before web-backed in-app pages request targeting decisions.
Changes:
- Adds targeting dependency prefetching for overlay and embedded flows.
- Caches fetch failures per session and centralizes requested-targeting checks.
- Expands unit coverage for prefetch ordering, failures, and cancellation.
| File | Description |
|---|---|
InAppProcessingManagerTest.kt |
Tests prefetch and requested targeting behavior. |
InAppInteractorImplTest.kt |
Tests overlay-triggered prefetching. |
EmbeddedResolveInteractorTest.kt |
Tests embedded prefetch ordering. |
InAppSegmentationRepositoryTest.kt |
Tests segmentation failure caching. |
InAppGeoRepositoryTest.kt |
Tests geo failure caching. |
InAppProcessingManager.kt |
Adds prefetch and requested-targeting APIs. |
InAppProcessingManagerImpl.kt |
Implements dependency prefetching and error handling. |
InAppInteractorImpl.kt |
Integrates prefetching into page-hosting flows. |
InAppSegmentationRepositoryImpl.kt |
Caches segmentation network failures. |
InAppGeoRepositoryImpl.kt |
Caches geo network failures. |
Extensions.kt |
Detects variants containing web pages. |
EmbeddedBlockRevealAnimation.kt |
Changes reveal animation easing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
justSmK
approved these changes
Oct 8, 2026
added 3 commits
October 8, 2026 18:57
…p cancellation out of ShowFailure - A place pass that fetched its targeting dependencies into one session and would have matched candidates against the next one now resolves again, once, for the new session instead of answering the block from mixed state. - Cancellation surfacing inside chooseInAppToShow's network wait (reachable now that the gateway is cancellable) is rethrown before the UNKNOWN_ERROR branch, so no false Inapp.ShowFailure goes out. - Tests: success twins for the session-reset cases, two callers on one mutex, cancellation inside the lock, Volley request cancelled with the coroutine.
…ions - Place targeting that matches from the session cache collects nothing. - Geo caller cancelled while holding the lock leaves the next caller a fetch. - checkCustomerSegmentations cancels its Volley request with the coroutine. - The chooseInAppToShow cancellation test is named for what it asserts.
- The page's question saves the available config's in-apps into the session before checking, so a page asking right after a reset keeps its segment ids. - A place pass checks the session identity again once the winner is picked, right before its targetings go out, drops the failures the abandoned pass collected, and resolves again as a plain place request of the new session instead of replaying the old session's operation. - sendTargetedInApp(inApp, event) rethrows cancellation like chooseInAppToShow. - The cache-hit test runs on the real repository; the cancellation test makes the targeting pass so "no targeting sent" is proved by the cancellation.
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.


https://tracker.yandex.ru/MOBILE-458