-
Notifications
You must be signed in to change notification settings - Fork 6
MOBILE-451:Resolve a place as if its last operation were still in effect for the session #773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8c9f7cd
MOBILE-451: Resolve a place as if its last operation were still in ef…
a8a9cdf
MOBILE-451: Move the session cells into SessionState and reset them a…
e2237d8
MOBILE-451: Read the session cells through SessionState and drop the …
dd15c7c
MOBILE-451: additional log for headers
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
49 changes: 49 additions & 0 deletions
49
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/data/managers/SessionState.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package cloud.mindbox.mobile_sdk.inapp.data.managers | ||
|
|
||
| import cloud.mindbox.mobile_sdk.inapp.domain.interfaces.managers.ShowBudgetOwner | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.CustomerSegmentationFetchStatus | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.GeoFetchStatus | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.InApp | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.InAppShowLimitsSettings | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.ProductSegmentationFetchStatus | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.ProductSegmentationResponseWrapper | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.SegmentationCheckWrapper | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.ShowReservation | ||
| import cloud.mindbox.mobile_sdk.inapp.domain.models.TargetingErrorKey | ||
| import cloud.mindbox.mobile_sdk.models.InAppEventType | ||
| import cloud.mindbox.mobile_sdk.models.PlaceKey | ||
| import cloud.mindbox.mobile_sdk.newConcurrentSet | ||
| import java.util.concurrent.ConcurrentHashMap | ||
| import java.util.concurrent.CopyOnWriteArrayList | ||
| import kotlin.time.Duration | ||
| import kotlin.time.Duration.Companion.milliseconds | ||
|
|
||
| internal class SessionState( | ||
| @Volatile var inAppCustomerSegmentations: SegmentationCheckWrapper? = null, | ||
| var unShownOperationalInApps: ConcurrentHashMap<String, MutableList<InApp>> = ConcurrentHashMap(), | ||
| var operationalInApps: ConcurrentHashMap<String, MutableList<InApp>> = ConcurrentHashMap(), | ||
| var inAppMessageShownInSession: MutableList<String> = CopyOnWriteArrayList(), | ||
| val embeddedLastShownByPlace: ConcurrentHashMap<PlaceKey, String> = ConcurrentHashMap(), | ||
| val embeddedLastTargetedByPlace: ConcurrentHashMap<PlaceKey, String> = ConcurrentHashMap(), | ||
| val embeddedLastOperationByPlace: ConcurrentHashMap<PlaceKey, InAppEventType.OrdinalEvent> = ConcurrentHashMap(), | ||
| val placeTargetingReportedInSession: MutableSet<String> = newConcurrentSet(), | ||
| val embeddedDelaysWaitedOut: MutableSet<String> = newConcurrentSet(), | ||
| val requestedInAppTargetingReportedInSession: MutableSet<String> = newConcurrentSet(), | ||
| val waitBudgetReportedPlaces: MutableSet<PlaceKey> = newConcurrentSet(), | ||
| val reportedShowFailures: MutableSet<String> = newConcurrentSet(), | ||
| val showReservations: MutableMap<ShowBudgetOwner, ShowReservation> = ConcurrentHashMap(), | ||
| var customerSegmentationFetchStatus: CustomerSegmentationFetchStatus = | ||
| CustomerSegmentationFetchStatus.SEGMENTATION_NOT_FETCHED, | ||
| var geoFetchStatus: GeoFetchStatus = GeoFetchStatus.GEO_NOT_FETCHED, | ||
| var inAppProductSegmentations: MutableMap<Pair<String, String>, Set<ProductSegmentationResponseWrapper>> = | ||
| ConcurrentHashMap(), | ||
| var processedProductSegmentations: MutableMap<Pair<String, String>, ProductSegmentationFetchStatus> = | ||
| ConcurrentHashMap(), | ||
| var lastTargetingErrors: MutableMap<TargetingErrorKey, String> = ConcurrentHashMap(), | ||
| @Volatile var currentSessionInApps: List<InApp> = emptyList(), | ||
| var shownInAppIdsWithEvents: ConcurrentHashMap<String, MutableSet<Int>> = ConcurrentHashMap(), | ||
| var configFetchingError: Boolean = false, | ||
| var sessionTime: Duration = 0L.milliseconds, | ||
| var inAppShowLimitsSettings: InAppShowLimitsSettings = InAppShowLimitsSettings(), | ||
| var inAppTriggerEvent: InAppEventType? = null, | ||
| ) | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.