Skip to content

feat: adopt MessageOrigin API and remove ApplicationMessage.app#164

Merged
sanity merged 8 commits intomainfrom
feat/delegate-message-origin
Mar 13, 2026
Merged

feat: adopt MessageOrigin API and remove ApplicationMessage.app#164
sanity merged 8 commits intomainfrom
feat/delegate-message-origin

Conversation

@iduartgomez
Copy link
Contributor

Problem

Chat-delegate uses the old attested: Option<&'static [u8]> delegate API and ApplicationMessage.app field which are being removed in freenet-stdlib.

Solution

  • Update process() signature to use origin: Option<MessageOrigin>
  • Extract ContractInstanceId from MessageOrigin::WebApp instead of raw bytes
  • Remove app parameter from handler functions and create_app_response
  • Use ApplicationMessage::new(payload) (single-arg) in UI

Testing

  • 9 chat-delegate unit tests pass
  • Build succeeds

Dependencies

Depends on freenet/freenet-stdlib#61

Update chat-delegate and UI to use the new typed MessageOrigin enum
from freenet-stdlib. The origin contract ID is now extracted from
MessageOrigin::WebApp instead of ApplicationMessage.app.

Depends on: freenet-stdlib feat/delegate-message-origin
- Add net feature to room-contract dev-dependencies for WebApi
- Add V7 legacy delegate migration entry for pre-0.3.2 WASM hash
- Rebuild and sync WASM artifacts
room-contract tests use WebApi which requires the net feature on
freenet-stdlib. Previously this worked via feature unification with
the freenet dev-dep (both resolved to stdlib 0.1.40), but now the
workspace uses 0.3.2 while the freenet dev-dep uses 0.1.40, so
features don't unify across major versions.

Added a net feature flag to room-contract and enabled it in CI.
…-stdlib symbols

The `freenet` dev-dep pulls in freenet-stdlib 0.1.x while the workspace uses 0.3.2,
causing duplicate `#[no_mangle] __frnt_set_id` symbols at link time. Gate the
integration test (already `#[ignore]`) behind `integration-test` feature so it
only compiles when explicitly requested.
@sanity sanity merged commit 6fad237 into main Mar 13, 2026
6 checks passed
sanity added a commit that referenced this pull request Mar 13, 2026
PR #164 committed WASMs that don't match a clean build against the
new stdlib version. Rebuild from clean state to ensure consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants