WAMP Flatbuffers serialization test coverage; WAMP message classes refactoring#1773
Conversation
Implements script to generate FlatBuffers test vectors for wamp-proto testsuite: - Created gen_flatbuffers_testvectors.py in examples/serdes/ - Supports all 25 WAMP message types (constructor logic) - Currently generates vectors for EVENT and PUBLISH (only types with FlatBuffers schemas) - Includes enum mapping for E2EE payloads (Payload and Serializer enums) Generator workflow: 1. Loads test vectors from wamp-proto/testsuite/singlemessage/basic/ 2. Creates WAMP message objects from expected_attributes 3. Serializes to FlatBuffers using message.build(builder) 4. Adds bytes_hex to JSON under flatbuffers serializer 5. Saves updated JSON back to wamp-proto Addresses crossbario#1771 - FlatBuffers test coverage for SerDes
…lization
This commit achieves 100% test coverage for EVENT and PUBLISH message
types with FlatBuffers serialization (0 failed, 0 skipped tests).
Changes:
- Fix Event.retained property getter to only return non-default (True)
values from FlatBuffers, preventing spurious {"retained": false} in
cross-serializer conversions (autobahn/wamp/message.py:5352-5358)
- Fix Event.marshal() and Publish.marshal() to convert memoryview to
bytes for JSON/msgpack/ubjson compatibility while preserving zero-copy
efficiency for FlatBuffers (autobahn/wamp/message.py:5830, 4102)
- Update .proto submodule with regenerated FlatBuffers test vectors for
EVENT and PUBLISH that include all 4 samples without default values
Test Results:
- 172 tests passed for EVENT and PUBLISH (all serializers)
- 0 tests failed
- 0 tests skipped
- All cross-serializer preservation tests passing
Fixes: crossbario#1771
Changes Principal from struct to table to support string fields (authid, authrole) required for forward_for implementation in EVENT and PUBLISH. Changes: - autobahn/wamp/flatbuffers/types.fbs: Convert Principal from struct to table to support authid and authrole string fields - autobahn/wamp/gen/schema/*.bfbs: Regenerated FlatBuffers compiled schemas after types.fbs change - autobahn/wamp/gen/wamp/proto/*.py: Regenerated Python code from schemas using flatc compiler, with manual import path fixes for Principal (changed from "from wamp.proto.Principal" to "from autobahn.wamp.gen.wamp.proto.Principal") - examples/serdes/gen_flatbuffers_testvectors.py: Updated test vector generator script - examples/serdes/tests/test_*.py: Cleanup/updates These changes enable forward_for support in FlatBuffers serialization for EVENT and PUBLISH messages with router-to-router forwarding. Related: crossbario#1771
Points .proto submodule to commit with regenerated FlatBuffers test vectors for EVENT and PUBLISH, required for tests to pass.
Document the multiple inheritance design pattern for WAMP message classes, introducing MessageWithAppPayload and MessageWithForwardFor mixins. This architectural specification maps the 4 message categories (from WIP_E2EE_AND_RLINKS.md) to a clean mixin-based implementation that eliminates code duplication while maintaining API compatibility. The documentation covers: - The "6-set" of application payload attributes that always co-occur - Payload serialization architecture (transport vs payload serializers) - Zero-copy optimization strategy with memoryview support - FlexBuffers integration for quasi-dynamic typing - Validation rules for E2EE attribute co-occurrence - Complete examples and migration notes This serves as the specification for the upcoming refactoring of autobahn.wamp.message classes.
Add MessageWithAppPayload and MessageWithForwardFor mixin classes to eliminate code duplication and implement the architectural pattern documented in docs/wamp/message-design.rst. Key changes: - MessageWithAppPayload: Encapsulates the "6-set" of application payload attributes (args, kwargs, payload, enc_algo, enc_key, enc_serializer) with support for multiple serializers and zero-copy optimization - MessageWithForwardFor: Encapsulates router forwarding chain metadata - Refactored Publish class to use both mixins (Category 4 message) Technical details: - Mixins inherit from object (not Message) to avoid __slots__ conflicts - Use _init_app_payload() and _init_forward_for() methods instead of __init__ - Concrete classes explicitly inherit from Message for proper MRO - All 460 serdes tests pass, confirming API compatibility This is the first step in refactoring all Category 3 and 4 messages per the documented design plan.
Added comprehensive technical documentation for the __slots__ multiple
inheritance pattern used in WAMP message classes:
1. docs/wamp/message-design.rst:
- New section "Technical Implementation: __slots__ and Initialization"
- Explains why empty __slots__ = () is critical (vs no __slots__)
- Documents memory layout and MRO in multiple inheritance
- Shows initialization pattern with explicit methods vs super()
- Provides concrete Publish class example
2. autobahn/wamp/message.py:
- Enhanced MessageWithAppPayload docstring with __slots__ warning
- Enhanced MessageWithForwardFor docstring with __slots__ warning
- Improved forward_for property getter/setter docstrings:
* Clarifies primary purpose is for ALL serializers
* Notes lazy deserialization is FlatBuffers-specific
- Improved Publish.__slots__ comments:
* Added note about Message base class inheritance
* Added FlatBuffers schema types for each slot
* Converted to inline comments (Python style)
All changes are documentation-only; tests pass (99/99 for Publish).
Refactored Event and Call message classes to use the mixin-based architecture: Event message changes: - Class now inherits from MessageWithAppPayload, MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_app_payload() and _init_forward_for() - Removed duplicate properties (args, kwargs, payload, enc_algo, enc_key, enc_serializer, forward_for) - now provided by mixins - All 73 tests pass Call message changes: - Class now inherits from MessageWithAppPayload, MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_app_payload() and _init_forward_for() - Removed duplicate properties (args, kwargs, payload, enc_algo, enc_key, enc_serializer, forward_for) - now provided by mixins - All 12 tests pass (3 skipped - test vectors not available) Both messages maintain identical public API and behavior while eliminating code duplication through the mixin pattern.
Refactored the remaining Category 4 message classes to use the mixin-based architecture, completing the migration of all 7 Category 4 messages. Error message changes: - Class now inherits from MessageWithAppPayload, MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_app_payload() and _init_forward_for() - Removed duplicate properties now provided by mixins - All 12 tests pass (3 skipped - test vectors not available) Result message changes: - Class now inherits from MessageWithAppPayload, MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_app_payload() and _init_forward_for() - Removed duplicate properties now provided by mixins - All 12 tests pass (3 skipped - test vectors not available) Invocation message changes: - Class now inherits from MessageWithAppPayload, MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_app_payload() and _init_forward_for() - Removed duplicate properties now provided by mixins - All 12 tests pass (3 skipped - test vectors not available) Yield message changes: - Class now inherits from MessageWithAppPayload, MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_app_payload() and _init_forward_for() - Removed duplicate properties now provided by mixins - All 12 tests pass (3 skipped - test vectors not available) All Category 4 messages (PUBLISH, EVENT, CALL, RESULT, INVOCATION, YIELD, ERROR) now consistently use the mixin pattern for shared functionality, significantly reducing code duplication.
Refactored all six Category 3 message classes to use the MessageWithForwardFor mixin. These messages have forward_for but no application payload, so they only use MessageWithForwardFor (not MessageWithAppPayload). Subscribe message changes: - Class now inherits from MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_forward_for() - Removed duplicate forward_for property (now provided by mixin) - All 24 tests pass (3 skipped - test vectors not available) Unsubscribe message changes: - Class now inherits from MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_forward_for() - Removed duplicate forward_for property (now provided by mixin) - All 12 tests pass (3 skipped - test vectors not available) Register message changes: - Class now inherits from MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_forward_for() - Removed duplicate forward_for property (now provided by mixin) - All 12 tests pass (3 skipped - test vectors not available) Unregister message changes: - Class now inherits from MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_forward_for() and added from_fbs support - Added request and registration properties for FlatBuffers lazy deserialization - All 12 tests pass (3 skipped - test vectors not available) Cancel message changes: - Class now inherits from MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_forward_for() - Removed duplicate forward_for property (now provided by mixin) - All 12 tests pass (3 skipped - test vectors not available) Interrupt message changes: - Class now inherits from MessageWithForwardFor, Message - Updated __slots__ with FlatBuffers schema type comments - Modified __init__ to use _init_forward_for() - Removed duplicate forward_for property (now provided by mixin) - All 12 tests pass (3 skipped - test vectors not available) All Category 3 messages now consistently use the mixin pattern, eliminating approximately 50 lines of duplicate forward_for property code.
Regenerated FlatBuffers Python wrappers using flatc 25.9.23 to ensure they match exactly what the CI workflow generates. The regeneration changes import paths in the generated files from: from autobahn.wamp.gen.wamp.proto.Principal import Principal to: from wamp.proto.Principal import Principal This is due to flatc behavior and ensures reproducible builds in CI. Generated files affected: - Call.py, Cancel.py, Error.py, Event.py, Interrupt.py - Invocation.py, Publish.py, Result.py, Yield.py
Changed the autoformat recipe to use ruff without explicit --exclude flags, allowing it to respect the exclude list in pyproject.toml automatically. This ensures: - Single source of truth for exclusions (DRY principle) - autobahn/wamp/gen/* is consistently excluded from formatting - No need to sync exclude lists between justfile and pyproject.toml Before: ruff format --exclude ./tests ./autobahn ruff check --fix --exclude ./tests ./autobahn After: ruff format . ruff check --fix . The pyproject.toml exclude list already includes: - autobahn/wamp/gen/* - flatbuffers/* - deps/* - .tox, .git, __pycache__, etc.
Fixed import paths in FlatBuffers generated Python files to use absolute imports from the autobahn.wamp.gen package root. Issue: flatc generates relative imports like: from wamp.proto.Principal import Principal This fails at runtime with: ModuleNotFoundError: No module named 'wamp' Solution: Post-process generated files to use absolute imports: from autobahn.wamp.gen.wamp.proto.Principal import Principal Changes: 1. Fixed all 18 import statements in generated files 2. Updated build-fbs recipe to automatically fix imports after generation 3. All 460 serdes tests now pass The build-fbs recipe now includes a sed command to fix import paths immediately after flatc generation, ensuring CI and local builds match.
Ruff reformatted the SubscriberFeatures import to use multi-line style for consistency with the project's formatting standards. This is the final formatting difference between local and CI-generated FlatBuffers files. After this commit, checksums should match exactly.
Fixed broken GitHub Actions expression syntax at line 182 where the
matrix.arch variable was incorrectly split across multiple lines.
This was causing the macOS wheel build workflow to fail with:
hashFiles('pyproject.toml') failed
The expression is now on a single line as required by YAML syntax.
Changed from single-line format to multi-line format to match
the pattern used consistently in main.yml and wstest.yml:
key:
value-here
This should resolve the macOS wheel build failure where
hashFiles('pyproject.toml') was failing to parse correctly.
Systematic analysis of enumeration-like Options & Details across: - FlatBuffers schema (types.fbs) - Python implementation (message.py, types.py) - WAMP protocol specification (wamp-proto/rfc/) Key findings: - 2 critical issues (CancelMode enum wrong, InvocationPolicy inconsistency) - 4 medium priority gaps (Cipher enum, terminology, etc.) - 1 fully aligned (Match enum) Includes GitHub issue templates for critical fixes. Requires maintainer review before proceeding with fixes.
Updates .ai submodule to commit 7219c81: - Adds hints for acceptable acknowledgement of AI assistance in Git comments - Improves git hook guidance for commit message formatting This should make it clearer what acknowledgements are allowed in commits.
This commit implements Phase 1+2 from ENUMERATION_AUDIT_ANSWERS.md, introducing breaking changes to align FlatBuffers schema with WAMP spec. This is a bookmark commit for tracking downstream breakage. Schema changes (autobahn/wamp/flatbuffers/): - types.fbs: Fix CancelMode enum (SKIP=0, KILL=1, KILLNOWAIT=2, remove ABORT) - types.fbs: Rename Payload → PPTScheme, add MQTT, XBR, OPAQUE values - types.fbs: Rename Serializer → PPTSerializer - types.fbs: Add new PPTCipher enum (NULL, XSALSA20POLY1305, AES256GCM) - types.fbs: Add ppt_keyid attribute for string-based key identifiers - types.fbs: Convert all doc comments to Doxygen-style (///) - pubsub.fbs: Rename enc_algo→ppt_scheme, enc_serializer→ppt_serializer - pubsub.fbs: Add ppt_cipher field to Publish, Event, EventReceived - pubsub.fbs: Change enc_key:[uint8]→ppt_keyid:string (type change!) - rpc.fbs: Same attribute renames for Call, Result, Invocation, Yield - rpc.fbs: Fix Interrupt default mode (ABORT→KILL) - session.fbs: Update Error table with ppt_* attributes Python code changes (autobahn/wamp/message.py): - Remove Register.INVOKE_ALL constant (not in WAMP spec) - Update FlatBuffers accessor methods: EncAlgo()→PptScheme(), etc. - Update FlatBuffers builder methods: ErrorAddEncAlgo→ErrorAddPptScheme, etc. - Change enc_key from bytes to string (builder.CreateByteVector→CreateString) - Update enc_key property setter assertion (bytes→str) Generated code (autobahn/wamp/gen/): - Regenerate all FlatBuffers wrappers with new schema - Add new enum modules: PPTScheme.py, PPTSerializer.py, PPTCipher.py - Remove old enum modules: Payload.py, Serializer.py - Update all message modules with new accessor/builder method names BREAKING CHANGES: 1. FlatBuffers binary format incompatible with previous versions 2. enc_key changed from bytes ([uint8]) to string - API breaking 3. CancelMode.ABORT removed (now SKIP=0, KILL=1, KILLNOWAIT=2) 4. Register.INVOKE_ALL constant removed 5. Test vectors from wamp-proto need regeneration (12 SerDes test failures expected) Related: crossbario#1771 Phase: 1+2 of 3-phase implementation plan
Update gen_flatbuffers_testvectors.py to use new enum names after Phase 1+2 breaking changes (commit 6e63a99): - Import PPTScheme instead of Payload - Import PPTSerializer instead of Serializer - Update PAYLOAD_ALGO_MAP with new enum values (add MQTT, XBR) - Update SERIALIZER_MAP for new enum names - Change wamp-proto path from ../../../wamp-proto to .proto - Make script update existing FlatBuffers entries instead of skipping them This allows regenerating test vectors in wamp-proto after schema changes. Related: crossbario#1771
Update .proto submodule to include regenerated FlatBuffers test vectors for Event and Publish messages after PPT schema refactoring. This commit references wamp-proto commit 2d4b0d7 which contains the updated test vectors matching the new FlatBuffers schema. Related: crossbario#1771
…vectors Update .proto submodule to reference the correct wamp-proto commit (fc64d78) which contains the regenerated FlatBuffers test vectors for Event and Publish. This replaces the previous submodule reference (3d80604) which pointed to a commit that only existed locally and wasn't in the bare repo. Related: crossbario#1771
This commit implements Phase 3 of the FlatBuffers enhancement plan by adding and updating authentication and transport-related enumerations as specified in ENUMERATION_AUDIT_ANSWERS.md. Changes to autobahn/wamp/flatbuffers/auth.fbs: - Updated AuthMethod enum: Changed values to NULL=0, TICKET=1, CRA=2, SCRAM=3, CRYPTOSIGN=4 (removed ANONYMOUS, COOKIE, TLS values for consistency with WAMP spec naming) - Renamed ChannelBinding to TLSChannelBinding and expanded with RFC5929 and RFC9266 channel binding types: NULL, TLS_UNIQUE, TLS_UNIQUE_TELNET, TLS_SERVER_ENDPOINT, TLS_EXPORTER - Renamed Kdf to KDF and updated values: NULL, ARGON2ID13, PBKDF2 - Updated all field references to use new enum names (TLSChannelBinding, KDF) - Updated AuthScramChallenge default kdf value to ARGON2ID13 Changes to autobahn/wamp/flatbuffers/types.fbs: - Added TransportChannelType enum with values: NULL, FUNCTION, MEMORY, SERIAL, TCP, TLS (stream-based and message-based transport types) - Added TransportChannelFraming enum with values: NULL, NATIVE, WEBSOCKET, RAWSOCKET (transport framing mechanisms) - Added TransportChannelSerializer enum with values: NULL, JSON, MSGPACK, CBOR, UBJSON, OPAQUE, FLATBUFFERS, FLEXBUFFERS (serializers for transport) Regenerated FlatBuffers wrappers: - Generated 7 .bfbs binary schema files - Generated 71 Python wrapper files including new enums - All SerDes conformance tests pass: 460 passed, 69 skipped These changes are non-breaking as they only add new enum values and do not modify existing message structures or wire formats. Related to crossbario#1771 Note: This work was completed with AI assistance (Claude Code).
…ntation
This commit refactors the EVENT_RECEIVED message from Category 4 (Both Payload
and Forwarding) to Category 3 (Forwarding Only), and adds comprehensive category
documentation to all WAMP message types across the FlatBuffers schemas.
EventReceived Refactoring (Category 4 → Category 3):
- Removed application payload fields: payload, ppt_scheme, ppt_serializer,
ppt_cipher, ppt_keyid
- Added forward_for field for router mesh forwarding
- EventReceived is now a pure acknowledgment message without application payload
- Acknowledgments travel back through the reversed path of the originating EVENT
- Publisher session derived from forward_for[0] of originating EVENT
- Subscription ID implicit via publication ID correlation at originating router
Rationale for Category 3:
- EVENT_RECEIVED is a QoS acknowledgment ("I received event X")
- Not meant for application-level response data (use CALL/PUBLISH for that)
- Similar to PUBLISHED, SUBSCRIBED (acknowledgments without payload)
- Requires router mesh forwarding (subscriber → router → publisher)
- Carries only correlation/routing metadata, no application data
Message Category Documentation Added:
- types.fbs: Added category overview and per-message annotations to MessageType enum
- pubsub.fbs: Categorized all 7 PubSub messages
- rpc.fbs: Categorized all 10 RPC messages
- session.fbs: Categorized all 7 session messages
Category Distribution:
- Category 1 (Neither Payload nor Forwarding): 12 messages
HELLO, WELCOME, ABORT, CHALLENGE, AUTHENTICATE, GOODBYE,
SUBSCRIBE, SUBSCRIBED, UNSUBSCRIBE, UNSUBSCRIBED, PUBLISHED,
REGISTER, REGISTERED, UNREGISTER, UNREGISTERED
- Category 2 (Payload Only): 0 messages (architecturally empty)
- Category 3 (Forwarding Only): 3 messages
EVENT_RECEIVED, CANCEL, INTERRUPT
- Category 4 (Both Payload and Forwarding): 7 messages
ERROR, PUBLISH, EVENT, CALL, RESULT, INVOCATION, YIELD
Test Results:
- All SerDes conformance tests pass: 460 passed, 69 skipped
- FlatBuffers build successful: 7 .bfbs files, 71 Python wrappers generated
Related to crossbario#1771
Note: This work was completed with AI assistance (Claude Code).
This commit adds FlatBuffers serialization support for Category 1 (Neither Payload nor Forwarding) WAMP messages. ## Changes ### autobahn/wamp/message_fbs.py - Import all Category 1 message classes from auto-generated FlatBuffers code: * Session lifecycle: Hello, Welcome, Abort, Challenge, Authenticate, Goodbye * PubSub: Subscribe, Subscribed, Unsubscribe, Unsubscribed, Published * RPC: Register, Registered, Unregister, Unregistered - Import required enums: Match, InvocationPolicy, CancelMode - Export all imported classes in __all__ for use by test vector generator ### autobahn/wamp/message.py - Fix all Category 1 message build() methods to safely access session field - Use getattr(self, 'session', None) instead of self.session to avoid AttributeError when session attribute is not present - Applied to 13 message types: * Session: Hello, Welcome, Abort, Challenge, Authenticate, Goodbye * PubSub: Subscribe, Subscribed, Unsubscribe, Unsubscribed, Published * RPC: Register, Registered, Unregistered ### .proto (wamp-proto test vectors submodule) - Update submodule pointer to include FlatBuffers test samples for 12 messages - Test vectors now include FlatBuffers serialized representations alongside existing JSON, MsgPack, CBOR, UBJSON formats ## Status ✅ 12/13 Category 1 messages have FlatBuffers test coverage⚠️ Hello/Welcome require role object handling (separate issue)⚠️ Unregister missing build() method (to be addressed) ## Test Results Generator output: 14/22 files modified (Category 1 complete except roles) Note: This work was completed with AI assistance (Claude Code).
This commit completes FlatBuffers support for all 12 Category 1 messages (Neither Payload nor Forwarding), fixing "message type 0 not yet implemented" errors. Changes: 1. Message union wrapper in build() methods (autobahn/wamp/message.py): - Added Message union wrapper to all Category 1 message build() methods - Session: Abort, Challenge, Authenticate, Goodbye - PubSub: Subscribe, Subscribed, Published, Unsubscribe, Unsubscribed - RPC: Register, Registered, Unregistered - Wraps inner message table in Message union containing message type 2. AuthMethod enum mapping (autobahn/wamp/message.py): - Challenge.method property: Added AuthMethod enum-to-string deserialization - Challenge.build(): Added string-to-AuthMethod enum serialization - Maps: NULL=0, TICKET=1, CRA=2 (wampcra), SCRAM=3, CRYPTOSIGN=4 3. Forward_for field handling (autobahn/wamp/message.py): - MessageWithForwardFor.forward_for: Added hasattr() check for ForwardForLength - Prevents AttributeError for Category 1 messages without forward_for field 4. MESSAGE_TYPE_MAP update (autobahn/wamp/serializer.py): - Added all 12 Category 1 message types for FlatBuffers deserialization - Uses *Gen.MessageClass pattern for proper class references 5. Test vector update (.proto submodule): - Updated to commit 6256b99 with regenerated test vectors Results: - All FlatBuffers tests passing: 496 passed, 33 skipped, 0 failures - Category 1 messages: serialize ✓, deserialize ✓, roundtrip ✓ Fixes crossbario#1771 (partial - Category 1 complete) Note: This work was completed with AI assistance (Claude Code).
This commit implements FlatBuffers serialization/deserialization support for all 3 Category 3 messages (Forwarding Only). Changes: 1. Message union wrapper in build() methods (autobahn/wamp/message.py): - EventReceived.build() - line 6242 - Cancel.build() - line 7148 - Interrupt.build() - line 9562 - Wraps inner message table in Message union containing message type 2. Category 3 imports (autobahn/wamp/message_fbs.py): - Added EventReceivedGen, CancelGen, InterruptGen imports - Updated __all__ to export Category 3 Gen classes 3. MESSAGE_TYPE_MAP update (autobahn/wamp/serializer.py): - Added EVENT_RECEIVED (37) message type mapping - Added CANCEL (49) message type mapping - Added INTERRUPT (69) message type mapping - Uses *Gen.MessageClass pattern for proper class references Category 3 messages (3 total): - EventReceived: Subscriber acknowledges event reception (QoS level 2) - Cancel: Caller cancels pending call - Interrupt: Router interrupts pending invocation Test status: - All existing tests passing: 496 passed, 33 skipped, 0 failures - Category 3 tests skipped (no test vector files in wamp-proto yet) - Code ready for serialization/deserialization once test vectors exist Progress: - Category 1: Complete ✓ (12 messages) - Category 3: Complete ✓ (3 messages) - Category 4: Partial (Event, Publish working) Fixes crossbario#1771 (partial - Category 1 + 3 complete) Note: This work was completed with AI assistance (Claude Code).
…warding) Implements FlatBuffers serialization/deserialization for 5 Category 4 messages: - ERROR (8) - CALL (48) - RESULT (50) - INVOCATION (68) - YIELD (70) ## Changes: **autobahn/wamp/message.py:** - Added Message union wrapper to build() methods for all 5 Category 4 messages - Updated cast() methods to use wrapper classes instead of Gen classes - Fixed Error callee properties (callee, callee_authid, callee_authrole) to not access non-existent FlatBuffers fields - Made Call.__init__() request and procedure parameters optional for FlatBuffers deserialization - Added conditional assertions in Call.__init__() to skip validation when deserializing from FlatBuffers **autobahn/wamp/message_fbs.py:** - Added custom wrapper classes for Error, Call, Result, Invocation, Yield with *AsBytes() methods - Wrapper classes provide zero-copy memory access to args, kwargs, payload, and enc_key - Updated __all__ exports to include wrapper classes **autobahn/wamp/serializer.py:** - Updated MESSAGE_TYPE_MAP to use wrapper classes for all Category 4 messages **examples/serdes/gen_flatbuffers_testvectors.py:** - Fixed Invocation test vector generation (registration_id instead of registration) **wamp-proto submodule:** - Updated to commit 713b51b with Category 4 test vectors - Bumped .ai submodule to latest wamp-ai (7219c81) with improved git hooks ## Test Results: 511 passed, 18 skipped, 0 failures All Category 4 messages now support complete FlatBuffers serialization/deserialization with proper test coverage. Note: This work was completed with AI assistance (Claude Code).
|
local testing: |
|
full coverage, yay! Test Results Summary 529 passed, 0 skipped, 12 warnings in 1.70s 100% coverage - All WAMP message types now have complete FlatBuffers serialization support! What We Accomplished Category 1 (Neither Payload nor Forwarding) - 13 messages:
Category 3 (Forwarding Only) - 3 messages:
Category 4 (Both Payload and Forwarding) - 7 messages:
Total: 23/23 WAMP Message Types ✓ All messages have:
The only warnings are deprecation notices for builder.EndVector(len(...)) which should use builder.EndVector() instead - |
Goal: Add FlatBuffers serialization/deserialization for all WAMP message types Status: ✅ COMPLETE
Goal: Achieve full test coverage for WAMP message serialization Status: ✅ COMPLETE
Goal: Refactor message classes to cleanly support multiple serializers Status: ✅ COMPLETE
Known Limitations (Non-Blocking) Minor TODOs (cosmetic, not breaking):
|
Description
Related Issue(s)
Closes or relates to #1771
Checklist
the style guidelines of this project
is effective or that my feature works
updated the changelog
in this PR