Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

MLIBZ-2503: User.me() does not delete newly-empty fields on the SDK #299

Merged
merged 3 commits into from
May 24, 2018

Conversation

thomasconner
Copy link
Contributor

@thomasconner thomasconner commented May 24, 2018

Steps to reproduce

  1. Log into any web app using kinvey-html5-sdk
  2. Check the value of a field in the current user's record to make sure it is non-empty – both in the Console -> Identity -> Users page, and in the client app.
  3. In the Console -> Identity -> Users page, manually update/erase the value of the field.
  4. In the client app, call user.me() on the current user - the saved active user in the SDK is not updated with the deleted property - the code here merges the updated fields but does not remove deleted properties.

Expected result

The field value should be empty/deleted from the current user's data in the client.

Actual result

The field value still exists that was empty/deleted.

Changes

  • Remove merging of data returned in the response from the /_me endpoint. The active user data is now replaced with the data returned in the response from /_me endpoint.

Tests

  • Remove irrelevant unit tests due to this change.
  • Update an existing unit tests that checks that values are removed correctly.

@thomasconner thomasconner self-assigned this May 24, 2018
@thomasconner thomasconner requested a review from heyzooi May 24, 2018 19:18
Copy link
Contributor

@heyzooi heyzooi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple and clean! LGTM!

@thomasconner thomasconner merged commit e3f8aff into master May 24, 2018
@thomasconner thomasconner deleted the MLIBZ-2503 branch May 24, 2018 21:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants