Giter Site home page Giter Site logo

Comments (10)

Yoric avatar Yoric commented on July 22, 2024

I believe that the selector parser is too lenient. Here, it doesn't found anything to parse, so it assumes that we want all channels. This should be pretty easy to fix.

from foxbox.

Yoric avatar Yoric commented on July 22, 2024

Ah, got it. So, the id field in a ChannelSelector is a constraint with the type Exactly<Id<Channel>>. Passing null where there is an Exactly<_> is how we can specify "always match". So your selector means "Pick all the channels that have any id". So no bug here, just a confusing case.

I'll try and think of a way to make this less confusing/accident-prone. Since I'm planning on an evolution that will require us to provide the feature whenever we perform a fetch or send anyway, this might side-solve the problem.

from foxbox.

azasypkin avatar azasypkin commented on July 22, 2024

So no bug here

Yeah, no coding bug here in its classic sense! But rather the issue with too permissive API that can be too destructive and lead to unrecoverable consequences :)

from foxbox.

Yoric avatar Yoric commented on July 22, 2024

@azasypkin Not saying that it doesn't need to be fixed :)

Anyway, if you have a chance, could you test-drive the PR I just linked to and see if this solves the issue?

from foxbox.

azasypkin avatar azasypkin commented on July 22, 2024

Anyway, if you have a chance, could you test-drive the PR I just linked to and see if this solves the issue?

Sure, will give it a try today :)

from foxbox.

Yoric avatar Yoric commented on July 22, 2024

So, @azasypkin, does it help?

from foxbox.

azasypkin avatar azasypkin commented on July 22, 2024

Grrr, sorry completely forgot about this one. Looking...

from foxbox.

azasypkin avatar azasypkin commented on July 22, 2024

Hmm, is it correct PR (#525) @Yoric ?

I still see the same behavior with request like:
https://local.609aebe9f46a699f80d6e0284c3334ddf879e125.box.knilxof.org:3000/api/v1/channels/set' -X PUT -H ..... --data-binary '{"select":{"id":null},"value":null}' - simulated bug in the app when Id of the selected camera is not available for some reason and we pass null instead of take snapshot channel id.

from foxbox.

Yoric avatar Yoric commented on July 22, 2024

Oops, right, I had forgotten part of the patch. This should now be fixed.

from foxbox.

azasypkin avatar azasypkin commented on July 22, 2024

Mm, latest PR fails to compile :) https://travis-ci.org/fxbox/foxbox/jobs/138305574
src/taxonomy_router.rs:235:40: 235:66 error: type nameChannelSelectorWithFeatureis undefined or not in scope [E0412] src/taxonomy_router.rs:235 payload_api!(fetch_values, Vec<ChannelSelectorWithFeature>, ["channels", "get"], Method::Put, binary);

from foxbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.