Skip to content

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
masterfrom
feat/DEV-4686-namespace-base

Conversation

@Xyzcancer

@Xyzcancer Xyzcancer commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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 events tracking.bannerView and bannerClick) and reviews. Each method is a suspending call with a CompletionListener twin, checks its arguments before any request (invalidArgument) and fails with the contract's SdkError.

All of it is @BridgeApi and hidden from Java; on the legacy core, where apps run, every call fails with notInitialized without a request. Nothing existing is deprecated.

Rees46Config.appDomain names the host of API v3 (app.rees46.ru by default) for the polls and the search agent; apps built against 2.52 keep its constructor and copy. A 2xx {"status":"error"} to mobile_push_tokens is decoding and 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.

…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.
…ict.getProbabilityToPurchase() on the new core
…tatus and the customer's promotions with sdk.loyalty on the new core, without the shop's secret
…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
…ecommendations.get on the new core, whole products or only their ids in one model
… 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
@Xyzcancer Xyzcancer changed the title feat(core): the bridges' namespaces on the new core, with sdk.cart.get() first, and Rees46Config.appDomain feat(core): the bridges' namespaces on the new core: cart, products, collections, recommendations, search, profile, subscriptions, segments, notifications, stories, predict, loyalty, sliders, reviews Nov 17, 2026
…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}]
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