Skip to content

The ruby driver silently ignores unknown optional arguments #2052

Closed

Description

@AtnNn

This confused a user that was using camel case.

> r.connect(auth_key:"hunter2")
#<RethinkDB::Connection:0x00000001d67760>
> r.connect(authKey:"hunter2")
ERROR: incorrect authorization key

@mlucy pointed out that it would be best to fix this on server, which also silently ignores unknown optional arguments.

Activity

  1. added this to the subsequent milestone on Mar 3, 2014
  2. mlucy commented on Mar 4, 2014

    @mlucy
    Member

    I think this check should be done on the server rather than in the clients. That way third-party drivers get it for free.

  3. coffeemug commented on Aug 13, 2014

    @coffeemug
    Contributor

    Assigning to @gchpaco

  4. mlucy commented on Aug 13, 2014

    @mlucy
    Member

    Note that optargs passed to connect need to be handled in the driver, but unknown global optional arguments should probably be rejected on the server.

  5. modified the milestones: , subsequent on Dec 12, 2014
  6. gchpaco commented on Jan 7, 2015

    @gchpaco
    Contributor

    Fix for the global optargs thing in CR 2436.

  7. added a commit that references this issue on Jan 7, 2015
  8. gchpaco commented on Jan 7, 2015

    @gchpaco
    Contributor

    Should be solved now.

  9. mlucy commented on Jan 9, 2015

    @mlucy
    Member

    Sorry to resurrect a dead horse, but re-opening briefly to talk about the set of accepted global optargs.

    The linked patch makes some global optargs which are currently accepted illegal. I'm not necessarily opposed to doing this, but it seems like a bad idea on the surface: it might break somebody's app and there's no real cost to accepting them. I could very easily see someone wanting to specify e.g. geo_system globally. It also seems strange that for some terms we now accept some but not all of their optargs at the global level. For example, you can set durability at the top level, but not non_atomic. I can imagine that being confusing.

  10. reopened this on Jan 9, 2015
  11. danielmewes commented on Jan 9, 2015

    @danielmewes
    Member

    The current list is based on what the JavaScript driver used to allow as global opt args.

    I personally am neutral on the question of whether to allow all opt args globally or only the selected ones.

  12. 3 remaining items

  13. danielmewes commented on Jan 9, 2015

    @danielmewes
    Member

    @gchpaco By "accepting all opt args" I meant accepting all opt args that are accepted by at least one of the terms. So we would just extend the list, definitely not revert your change.

  14. gchpaco commented on Jan 9, 2015

    @gchpaco
    Contributor

    OK.

  15. mlucy commented on Jan 9, 2015

    @mlucy
    Member

    really easy to forget adding a new opt arg to the list in the future

    If we do this, we should make the optargspec_t constructor guarantee that the optarg is in the global list. That way we'd get a crash the first time we tried to test a term using the new optarg.

    having to specify opt args at the term where they are being used makes sure people understand which terms a given opt arg has effects on

    Yeah. There are also some optargs which are just outright confusing at the toplevel (timeout doesn't specify a timeout for the whole query, it specifies the timeout for any r.js calls in the query).

  16. danielmewes commented on Jan 9, 2015

    @danielmewes
    Member

    If we do this, we should make the optargspec_t constructor guarantee that the optarg is in the global list. That way we'd get a crash the first time we tried to test a term using the new optarg.

    Ah that's a good idea.
    With that out of the way, I'm leaning towards having all opt args that are allowed somewhere to also be allowed globally.

  17. gchpaco commented on Jan 9, 2015

    @gchpaco
    Contributor

    Okay.

  18. mlucy commented on Jan 9, 2015

    @mlucy
    Member

    With that out of the way, I'm leaning towards having all opt args that are allowed somewhere to also be allowed globally.

    That sounds slightly better to me too. All hail backwards compatibility!

  19. gchpaco commented on Jan 13, 2015

    @gchpaco
    Contributor

    CR 2456.

  20. modified the milestones: , 1.16 on Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions