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

NEXT-00000 - Fix changeset issues #3695

Closed
wants to merge 4 commits into from

Conversation

jasperP98
Copy link
Contributor

1. Why is this change necessary?

When we generate a changeset and the before and after property are both null this will be seen a merge since the after property is being type casted to a string. This is incorrect, or both should be type casted or none.

When a JsonUpdateCommand is triggered for the same entity, this command will override the previous changeset, leading to incorrect write results.

2. What does this change do, exactly?

This change will type cast both the after and the before property.
This change will also merge the changeset from the JsonUpdateCommand and the previous command from the same entity.

3. Describe each step to reproduce the issue or behaviour.

/

4. Please link to the relevant issues (if any).

/

5. Checklist

  • I have rebased my changes to remove merge conflicts
  • I have written tests and verified that they fail without my change
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

@@ -74,6 +74,13 @@ public function hasChanged(string $property): bool
return \array_key_exists($property, $this->after) || $this->isDelete;
}

public function merge(ChangeSet $changeSet): void
Copy link
Member

Choose a reason for hiding this comment

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

Hi @jasperP98,

thanks for the bug fix, changes are looking good to me, but could you please provide some tests for it?

Integration tests would also be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @OliverSkroblin i will do this ASAP

Copy link
Contributor Author

@jasperP98 jasperP98 May 17, 2024

Choose a reason for hiding this comment

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

I created a UT to check the constructor and merge function from the changeset

@shopware-github-importer
Copy link

Hello,

thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-36282

Please use this issue to track the state of your pull request.

@OliverSkroblin
Copy link
Member

Hi,

can you please squash and rebase your commits? Otherwise i have issues to import and merge it.

Thanks in advance

@jasperP98
Copy link
Contributor Author

hi @OliverSkroblin

I synced the branch and cherry picked the commits. It should be fine now.

@shopware-github-importer
Copy link

Hello,

thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-36289

Please use this issue to track the state of your pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants