Skip to content

feat(sdk): multi-instance support — Rees46 facade, shop-aware push, demo - #14

Merged
Xyzcancer merged 3 commits into
masterfrom
feat/multiinstance-flutter
Aug 17, 2026
Merged

feat(sdk): multi-instance support — Rees46 facade, shop-aware push, demo#14
Xyzcancer merged 3 commits into
masterfrom
feat/multiinstance-flutter

Conversation

@Xyzcancer

Copy link
Copy Markdown
Contributor

No description provided.

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.
@Xyzcancer
Xyzcancer merged commit 27a94c6 into master Aug 17, 2026
3 checks passed
@Xyzcancer
Xyzcancer deleted the feat/multiinstance-flutter branch August 17, 2026 17:42
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