E40F Patching entity through service causes the socket entity to be wrongly updated · Issue #1049 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

Patching entity through service causes the socket entity to be wrongly updated #1049

@claustres

Description

@claustres

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0