Skip to content
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

Pass lid from belongsTo relationship data to get record data #7427

Closed
wants to merge 1 commit into from
Closed

Pass lid from belongsTo relationship data to get record data #7427

wants to merge 1 commit into from

Conversation

azhiv
Copy link
Contributor

@azhiv azhiv commented Feb 9, 2021

This patch is on tag 3.24, can it be delivered along with the next release?

This PR aims to fix #7424.
The issue appeared in the sideposting scenario:

  • model A has belongs to relationship to model B.
  • instance of model A and instance of model B are created on the client,
  • model A is saved along with model B sent in include section of payload; the linking is done through lid
  • server persisted both models and sent the response with server-generated id along with lid sent by the client.
  • when belongsTo.updateData() was called while the response payload was pushed to the store it couldn't match the record which was already in the store with the record data contained in the relationship data because lid was omitted.

Add a test which ensures that the belongsTo() relationship has correct status in the sideposting with lid scenario.

The issue appeared in the sideposting scenario:

- model A has belongs to relationship to model B.

- instance of model A and instance of model B are created on the client,

- model A is saved along with model B sent in `include` section of
  payload; the linking is done through `lid`

- server persisted both models and sent the response with
  server-generated `id` along with `lid` sent by the client.

- when belongsTo.updateData() was called while the response payload was
  pushed to the store it couldn't match the record which was already in
  the store with the record data contained in the relationship data
  because `lid` was omitted.

Add a test which ensures that the belongsTo() relationship has correct
status in the sideposting with lid scenario.
@azhiv azhiv changed the title Pass lid from relationship data to get record data Pass lid from belongsTo relationship data to get record data Feb 9, 2021
@azhiv azhiv closed this Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant