feat(sdk): multi-instance support — Rees46 facade, shop-aware push, demo - #14
Merged
Conversation
Bring multi-instance to the Flutter SDK, matching the native Android/iOS SDKs. The Flutter SDK is a Pigeon bridge over the native SDKs, so this threads shop identity through the bridge and reuses the native machinery (registry, storage partitions, migration, session isolation) instead of reimplementing it. Public API (mirrors native): - Rees46.initialize / registerShops / getInstance, with the fail-fast resolution contract (UnknownShopIdException / AmbiguousShopException). - handlePush(payload, event) routes an inbound push to its shop and drops the unroutable one. Bridge: - Thread shopId through every per-instance Pigeon call; the native bridges resolve each call via Rees46.getInstance(shopId) / Rees46.instance(for:). - A process-global dispatcher delivers inbound pushes to the shop the payload's shop_id names. Android push hardening: - Persist shop configs (Rees46ShopStore) and re-register them on a cold process start (Rees46PushInitProvider), so a killed-app push is routed and displayed instead of dropped on an empty registry. - Read the push token from the resolved instance's own storage partition via getPushToken, not the legacy shared prefs. Demo: - Two-shop screen; the main screen initializes through the facade. - Integration test for the resolution contract and push routing.
The mi-push-result label renders 'result: <value>' (dropped / routed:<shop>),
so match it with contains() — as the contract-result assertions already do —
instead of == 'dropped' / startsWith('routed:'), which the 'result: ' prefix
never satisfied.
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.
No description provided.