ably / specification

The Ably features spec for client library SDKs.
Apache License 2.0
0 stars 4 forks source link

Show a warning when invalid options are used in dynamic languages #77

Open mattheworiordan opened 6 years ago

mattheworiordan commented 6 years ago

See https://github.com/ably/ably-ruby/issues/126#issuecomment-382725426

We had a broken test because we were passing in invalid arguments where a Hash/Dictionary/Object is allowed.

With typed languages this is less of an issue, but with untyped languages it's all too easy to have a typo in the arguments / options / object you pass in, and thus result in developers spending a lot of time diagnosing these issues.

Given the number of interfaces we have for these types of objects is minimal, I propose we show a warning in dynamic languages when options are received that are not supported.

So for example:

var realtime = new Ably.Realtime({ key: apiKey, clientid: 'bob' });

Woud result in a warnign perhaps like:

warning: attribute `clientid` is not a supported attribute of ClientOptions. This attribute will be ignored.

WDYT?

┆Issue is synchronized with this Jira Task by Unito

mattheworiordan commented 6 years ago

See https://github.com/ably/ably-ruby/issues/124. It's an old issue that has been asked for before 👍

sync-by-unito[bot] commented 2 years ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-2822