mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Move the decode → broker → encode orchestration out of Android's NappletBrokerService.handleMessage and into a pure, transport-free NappletRequestRouter in commons/jvmAndroid. It returns a small Outcome (Ignore / Reply / OpenSubscription / CloseSubscription / Push) that each host acts on, so the Android service and the future desktop host share the routing brain and can't drift on wire behavior. The service now resolves the broker and dispatches on the Outcome, supplying only the Messenger transport and the live relay subscription. openLiveSubscription takes the decoded filters from the router instead of re-decoding the payload, and the now-redundant process() is removed. Unit-tested in commons/jvmTest (NappletRequestRouterTest). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ncMHuBBVHEf7spAoSssde