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

Do not store references as an unique static property in mysql backup #79

Merged
merged 2 commits into from
Dec 9, 2020

Conversation

magnetik
Copy link
Contributor

@magnetik magnetik commented Dec 9, 2020

The list of references were stored as a single property.

As a consequence, when loading different fixtures, some reference can be missing during runtime.

I do not see any time loss loading the reference file (issuing a file_get_contents is not be the slow part)

@alexislefebvre
Copy link
Collaborator

The changes looks good to me, thanks!

However I don't understand this part:

As a consequence, when loading different fixtures, some reference can be missing during runtime.

Could you please explain? It looks like the behaviour will be the same before and after the change: the content of $this->getReferenceBackupFilePath() will be returned by this method.

@magnetik
Copy link
Contributor Author

magnetik commented Dec 9, 2020

Could you please explain? It looks like the behaviour will be the same before and after the change: the content of $this->getReferenceBackupFilePath() will be returned by this method.

But getBackupFilePath() result will depend on $this->metadatas and $this->classNames while $this->getReferenceBackupFilePath won't.

So let's say I load the fixtures User::class, the backup is loaded the references were loaded and stored as static property.

Then when I load [ User::class, Foobar::class ], the right backup is loaded, but the references with only User::class will be loaded.

@magnetik
Copy link
Contributor Author

magnetik commented Dec 9, 2020

I've added a test that is not passing before the fix, and is passing after

[edit] My reproduction was not exactly the same as the test : it was two different test that were loading different fixtures.

@alexislefebvre
Copy link
Collaborator

Thanks, I thought that getReferenceBackupFilePath would always return the same data but I was wrong. So the cache was useless and created issues like you explained.

@alexislefebvre alexislefebvre merged commit 52cc3b6 into liip:master Dec 9, 2020
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.

2 participants