Repository navigation
feat(core): the bridges' namespaces on the new core: cart, products, collections, recommendations, search, profile, subscriptions, segments, notifications, stories, predict, loyalty, sliders, reviews - #245
Open
Xyzcancer wants to merge 38 commits into
Conversation
…46.ru by default, and apps built against 2.52 keep its constructor and copy
… contract's SdkError, as a suspending call or through a CompletionListener on the main thread, and fails with notInitialized on the legacy core The request waits for the instance within its read timeout and is never repeated; release() ends it with cancelled. A method may set a read timeout of its own for its request. Answers are read tolerantly: missing fields and null are null, numbers may come as strings, an unknown value of a closed set is null.
…sh token and set push callbacks through sdk.notifications on the new core trackDelivered, trackOpened, trackClicked and trackClosed go through the queue once per message in a process and end once the event is accepted; a repeat ends in success, and a tap sets the tracking source as handlePush does. getPushToken takes an optional provider: without one it is the provider the shop sent last, or the device's token, FCM before HMS. setPushToken follows the token's weekly rules and ends in the contract's SdkError. On the legacy core every call sends nothing, fails with notInitialized and logs core_flag_mismatch. Fixtures in the contract's format: contract/0/notifications.json.
…stories.get(code) on the new core
…ict.getProbabilityToPurchase() on the new core
…tatus and the customer's promotions with sdk.loyalty on the new core, without the shop's secret
…) on the new core
…uest and a namespace's event goes through the new core's queue, both notInitialized on the legacy core; a list in a GET query goes as its key repeated
… tracking.bannerView and bannerClick, through the new core's queue only
… core — a product card, a listing with its facets, a product's counters and a category's screen — checked and answered in the contract's models
…ections.get on the new core
…ecommendations.get on the new core, whole products or only their ids in one model
…nt and full on the new core
…decoding, as on iOS
… write the profile with sdk.profile on the new core, checked before the request
…tions and subscribe to a product's price or stock with sdk.subscriptions on the new core
… read their segments and the device's A/B group with sdk.segments on the new core
…46Config.appDomain, app.rees46.ru unless the shop's cluster has its own, through the new core with the same common fields
…lls' dictionaries on appDomain, and the reviews of a product or of an order on the API, with sdk.reviews on the new core
… namespaces # Conflicts: # personalization-sdk/src/main/kotlin/com/personalization/SDK.kt # personalization-sdk/src/main/kotlin/com/personalization/core/BridgeApi.kt # personalization-sdk/src/main/kotlin/com/personalization/core/internal/NamespaceCalls.kt
# Conflicts: # personalization-sdk/src/main/kotlin/com/personalization/SDK.kt # personalization-sdk/src/main/kotlin/com/personalization/core/BridgeApi.kt
…46Config.appDomain, app.rees46.ru unless the shop's cluster has its own, through the new core with the same common fields
…ialog and agent on the shop's appDomain, and read sdk.search.agentEnabled from the init answer, on the new core
# Conflicts: # personalization-sdk/src/main/kotlin/com/personalization/SDK.kt # personalization-sdk/src/main/kotlin/com/personalization/core/BridgeApi.kt # personalization-sdk/src/test/kotlin/com/personalization/core/internal/NamespaceFixtures.kt
# Conflicts: # personalization-sdk/src/test/kotlin/com/personalization/core/internal/NamespaceFixtures.kt
… method, banner event and push call refuses the legacy core first and a wrong argument next through NamespaceCalls.checked, with the same errors as before
checkArguments, request(refused = …) and requireNewCore() give way to checked { … }, which the
catalog's methods used already; loyalty, sliders, stories and reviews build their fields with the
shared helpers of NamespaceArguments, the namespaces' properties of SDK follow the contract's order,
and BridgeApi lists each namespace once.
…kens is decoding for every listener of the send and leaves the token's week free, so the next send goes again, as on iOS
…bability-to-purchase on the shop's appDomain and reads its payload, since the API host's path answers 503 for good
…s "" so the server erases it, keeps an empty email, phone or loyaltyId as invalidArgument, and refuses a birthday that is not an existing date of the years 1000 to 2999
…hich the server would erase the stored date with, and a promotion's id is a 64-bit Long
…iews are 64-bit Longs, and a repeated rating keeps or clears its comment as the server does
…gument are 64-bit Longs, and its 403 and the 503 of the control group end as http(403) and http(503)
…/cdp/users/probability-to-purchase on the shop's appDomain on both cores, as sdk.predict does, and reads its payload into PurchasePredictResponse, since the API host's path answers 503
…s/get sends as an object of the parameter's name, in the card's order, while the lists send [{key, values}]
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.
Bridges get the contract's namespaces on the new core:
cart,products,collections,recommendations,search(with the search agent),profile,subscriptions,segments,notifications,stories,predict,loyalty,sliders(with the banner eventstracking.bannerViewandbannerClick) andreviews. Each method is a suspending call with aCompletionListenertwin, checks its arguments before any request (invalidArgument) and fails with the contract'sSdkError.All of it is
@BridgeApiand hidden from Java; on the legacy core, where apps run, every call fails withnotInitializedwithout a request. Nothing existing is deprecated.Rees46Config.appDomainnames the host of API v3 (app.rees46.ruby default) for the polls and the search agent; apps built against 2.52 keep its constructor andcopy. A2xx{"status":"error"}tomobile_push_tokensisdecodingand leaves the token's week free, as on iOS.Not here: the methods that need the shop's secret (
getUserOrders, the notification history, the polls' review lists…) and the promo code.