question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Whitelisted operators not allowed despite whitelisting

See original GitHub issue

Steps to reproduce

(First please check that this issue is not already solved as described here)

  • Tell us what broke. The more detailed the better.
  • [] If you can, please create a simple example that reproduces the issue and link to a gist, jsbin, repo, etc.

Expected behavior

Tell us what should happen

I whitelisted $iLike using the whitelist option while initialising feathersVuex:

const { makeServicePlugin, makeAuthPlugin, BaseModel, models, FeathersVuex } = feathersVuex(feathersClient, {
    whitelist: ['$regex', '$options', '$iLike', '$like'],
});

Actual behavior

When trying to use one of these query operators using the useFind() composable, the following error is thrown: [Vue warn]: Error in render: "Error: Unknown operation $iLike"

 const findData = useFind({
            model: models.api.Project,
            params: { // actually a computed() from elsewhere
                        query: {
                                    name: { $iLike: '%foobar%' }
                        }
            } 
});

System configuration

Using the new composition API

Module versions (especially the part that’s not working): Vue 2.6.10 Composition-api 0.3.4 Feathers-vuex 3.2.1 Feathers (client) 4.4.3

NodeJS version: 12.0.0

Operating System: OSX 10.15.1

Browser Version:

Latest Chrome at the time of writing

Module Loader:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
yohane55commented, Jun 7, 2021

I think this a bug in useFind of composition api. I added it in whitelist and paramsForServer but not working.

// This throws a feathers error  -> BadRequest "Invalid query parameter $like"
feathersVuex(feathersClient, {
  serverAlias: "api", // optional for working with multiple APIs (this is the default value)
  idField: "id", // Must match the id field in your database table/collection
  whitelist: ["$regex", "$options"],
  paramsForServer: ["$like"],
  enableEvents: process.client // Prevent memory leak
});
//if I add it to both paramsForServer and whitelist, the is error thrown by sift
feathersVuex(feathersClient, {
  serverAlias: "api", // optional for working with multiple APIs (this is the default value)
  idField: "id", // Must match the id field in your database table/collection
  whitelist: ["$regex", "$options", "$like"],
  paramsForServer: ["$like"],
  enableEvents: process.client // Prevent memory leak
});

In my old project with ...mapActions & ...mapGetter, it works without whitelisting or other configuration. @marshallswain or @J3m5 will you work on to fix this or should we give up on composition api for now?

0reactions
jonascriptcommented, Dec 13, 2022

I’m unable to get this to work with $regex, $like or $iLike as well using feathers-sequelize despite whitelisting params paramsForServer.

It does work if I use the dispatch (non composition api) method $store.dispatch('myservice/find', { query: { $iLike: '%foo%'} }) This means you cannot use feathers-sequelize with composition api if you want to do special operator queries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guidelines for Application Whitelisting in Industrial Control ...
When in “alert mode”, execution of non- whitelisted programs is not entirely blocked - the user is prompted and may choose to allow...
Read more >
How to Fix Whitelist Failure Error in Call of Duty: Warzone
Whitelist Failure seems to be related to players being unable to join servers. ...
Read more >
What is Whitelist (Allowlist)? - TechTarget
While a whitelist is a list of applications or services that are explicitly permitted, blacklisted or blocklisted applications or services are explicitly denied...
Read more >
Cant get Whitelisting to work : r/admincraft - Reddit
I have enabled whitelisting in both the server.properties and have also tried to enable whitelisting through the console with whitelist on.
Read more >
A Quick Guide to Email Whitelisting and Blacklisting
How do I whitelist an email sender? Whitelisting is not complicated but can take a few tries if you've never done it. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found