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

fix: circular reference save #5140

Closed
wants to merge 6 commits into from
Closed

Conversation

a631807682
Copy link
Member

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Circular reference in model causes app freeze, should stop saveAssociations loop if relation model has been created.
close #4935

@jinzhu
Copy link
Member

jinzhu commented Mar 12, 2022

if a user has many children, and only one of them have been saved, then it won't save other children? looks like an issue?

@a631807682
Copy link
Member Author

if a user has many children, and only one of them have been saved, then it won't save other children? looks like an issue?

I will create test for them.

@a631807682
Copy link
Member Author

I create a test for LoadOrStoreVisitMap.
If one of them haven't been saved, then all children will be save again.
I don't know if I should change values to exclude saved children, because it looks like values is a reference and will be changed by tx.Create(values)
@jinzhu

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.

Circular reference in model causes app freeze
2 participants