feathers: Patching entity through service causes the socket entity to be wrongly updated

Steps to reproduce

This behavior seems to have appeared after the migration to V3.

Authenticate a user which data model has two properties email and name. Patch one of the property like app.service('users').patch(id, { name: 'xxx' }). After patch the user entity attached to the socket has lost the email property. It will cause any hook or operation depending on it to stop working on next service call.

Expected behavior

The socket entity should be correctly patched.

Actual behavior

The socket entity is updated instead of being patched.

This code could be the problem since the same function is called for both update or patch operations and this function delete properties based on the input object.

System configuration

Module versions:

"@feathersjs/authentication": "^2.1.7",
"@feathersjs/authentication-jwt": "^2.0.1",
"@feathersjs/authentication-local": "^1.2.1",
"@feathersjs/authentication-oauth2": "^1.1.0",
"@feathersjs/client": "^3.5.3",
"@feathersjs/configuration": "^1.0.2",
"@feathersjs/errors": "^3.3.0",
"@feathersjs/express": "^1.2.3",
"@feathersjs/feathers": "^3.1.7",
"@feathersjs/socketio": "^3.2.2"

NodeJS version: 8

Operating System: Windows

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Ah sorry about that, I haven’t gotten a chance to test this on Windows yet. I think https://github.com/feathersjs/feathers/pull/1051 should help with this problem.