Skip to content

zenoh-ts API doesn't protect against misuse of "option" structures #368

@milyin

Description

@milyin

It's technically possible to pass PutOptions into Publisher::put() which actually expects it's subset PublisherPutOptions. Typescript type system doesn't catch it: extra fields are just silently ignored.

This may cause wrong expectations. E.g. without consulting to documentation user may suppose that he can change priority or congestion control for individual put operation in publisher. The problem is amplified by using AI for code generation.

The solution is to improve zenoh-ts API by adding compile-time branding for "options" structures which will block misusing these structures when types are not exactly match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeIndicates that the issue implies a breaking change (be it at compile time or at runtime)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions