-
-
Notifications
You must be signed in to change notification settings - Fork 44
Consistent custom attributes for HELLO + separate tests set #542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
it("SUBSCRIBE.Options - supports custom attributes", async function () { | ||
await wampy.connect(); | ||
|
||
const customOptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Thnx for removing some AI-garbage....
But I still don't see how customOptions
are tested....
If they are not passed or are not correctly processed - then there will be no data-matching and default response for msg type will be returned. That's it. Where does the actual test happen?
Description, Motivation and Context
This PR implements consistent custom attributes validation across all WAMP message types according to WAMP specification 3.1. Previously, the
HELLO
message usedhelloCustomDetails
, which accepted any attributes without validation, while other messages used_extractCustomOptions
with proper regex validation (^_[a-z0-9_]{3,}$
).Bugfix
retain
option onpublish
.The change ensures all WAMP message types follow the same validation pattern for custom attributes, improving consistency and spec compliance.
What is the current behavior?
HELLO.Details
accepts any custom attributes without validation viahelloCustomDetails
SUBSCRIBE.Options
,PUBLISH.Options
,CALL.Options
, etc.) use_extractCustomOptions
with proper regex validationWhat is the new behavior?
_extractCustomOptions
validationHELLO.Details
now properly validates custom attributes using the same^_[a-z0-9_]{3,}$
patternWhat kind of change does this PR introduce?
Checklist: