-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There may be an interaction between softDelete and authentication #185
Comments
More info #163 (comment) |
I don't know if this is related, but I was trying out softDelete and it works as expected, the only problem I'm getting from it is it's still giving me
Even though it was able to successfully patch the item with
|
Am I correct in understanding you got the NotFound message during the
That would be the message you'd get if you tried a What DB are you using? Perhaps you can clarify the situation, or provide some code that shows the situation? |
@eddyystop Hi eddy. Yeah sure, it's actually a new toy project, I'm familiarizing myself with Auk so I can update some of our legacy projects that were using older versions/styles. The code is mostly boilerplate code yet from the latest https://github.com/johncrisostomo/voting-backend/tree/master/src/services/polls |
I couldn't find a Could you also run with |
Sorry for the late response and sorry because yeah I removed it from that code. I brought it back and tried to roll back |
Could you try this with v3.4.0 which will be published soon? #197 might affect this issue. In any case I want to eliminate it as a cause. Thanks. |
Just ran into this problem today, however I am using app.hooks.jsconst {softDelete} = require('feathers-hooks-common')
module.exports = {
before: {
all: [softDelete()],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: [],
},
...
} agents.hooks.jsconst {authenticate} = require('feathers-authentication').hooks
module.exports = {
before: {
all: [authenticate('jwt')],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: [],
},
...
} When I perform a REST {
"name": "NotFound",
"message": "Item not found.",
"code": 404,
"className": "not-found",
"errors": {}
} and When I move Here are my feathers versions:
|
I assume |
Perhaps you can add the Please let me know what happens. |
Added debug hooks to
After reviewing the code for The soft delete works after moving So, as long as |
I have service hooks like this:
In this case I can't run
|
I think so. Please inform us of your results. Thanks. |
Seems to be working |
Good to know. +1 |
Having the same problem here with the current version |
When I soft delete I received an item not found error, but the item is successfully soft deleted at the db. I`m using MongoDB. |
The problem happens when restrictToOwner is used at the remove hook with soft delete |
@rcostalenz Can you post a minimalist example reproducing this bug? To help identify the problem clearly and find a solution. |
Here it is, if you remove the
|
@rcostalenz, thank you for the example. It was the most useful I received. softDelete does probing It was not possible to get around this issue until the Feathers hook handler allowed SKIP to be returned.
posts.hooks({
before: {
all: [ paramsFromClient('$ignoreDeletedAt'), authenticate('jwt') ],
get: [ softDelete2(), restrictToOwner({ idField: 'id', ownerField: 'ownerId' }) ],
create: [ softDelete2(), restrictToOwner({ idField: 'id', ownerField: 'ownerId' }) ],
update: [ softDelete2(), restrictToOwner({ idField: 'id', ownerField: 'ownerId' }) ],
patch: [ softDelete2(), restrictToOwner({ idField: 'id', ownerField: 'ownerId' }) ],
remove: [ restrictToOwner({ idField: 'id', ownerField: 'ownerId' }), softDelete2() ]
},
after: {
all: softDelete2()
}
}); I'm closing this issue as softDelete2 will be released at the end of this week once its docs are done. |
Someone reported authentication working with softDelete in feathers-hooks-common v3.2.0 but not v3.3.0. The softDelete was on the
users
service.@ekryski is tracking the issue down, and is not positive the problem is with softDelete.
softDelete used to do 2
get
s forservice.get
, one withprovider: undefined
, the other withprovider: hook.para,s.provider
. Now it does just one withprovider: hook.params.provider
.The text was updated successfully, but these errors were encountered: