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
MailEclipse drops Meilisearch/Laravel scout records #214
Comments
Hi @vanrijs Sorry to hear that the package is doing this, it clearly shouldn't be affecting other packages. The only thing this sounds like is a possibility is that it is clearing db data for the mocking information. If I could ask, could you do the following to establish where the bug is: Use the maileclipse config and disable the usage of factories. In all the mail ales, remove type hints to eloquent orm models. (It should be replaced with a dynamic object which will still show calls) Generate your indexes The visit the page again and please let me know what happens |
Thanks @ReeceM. Im doing some tests now. |
Thank you, please keep me updated on what happens |
Hi @ReeceM. It has to do with the model bind. public function __construct($contract)
{
// model is already passed: its coming from an event listener
if($contract instanceof Contract) {
$this->contract = $contract;
} else {
$this->contract = Contract::with('responsible')->find(99475); // for editing mode, get fixed contract
}
$this->responsible = $this->contract->responsible;
} Don't have time now to do more research on what's going on exactly but my indexes keep intact now.. |
Hi there @vanrijs, So I would think that there would be a side effect from the package that when it creates a model using the factory. I am not sure if the scout package has a cascade side effect that drops data when the model is deleted as that is what the pacakge does after a factory is made... What I'll have to do is to look though the other package to see what might be happening. |
So I may have to give this a bit of thought to get an idea of what to do. Looking at the code there is a ModelObserver in the scout package that watches for deletes. Then clears out the index for that model. I suspect that if you are loading relations and other things like that it is possibly dropping those indexed details. Do you think that it is possible to spin up a simple repository to create a reproduction of this issue? |
Describe the bug
Hi all,
Installed MailEclipse last week now I noticed that is drops my Meilisearch/Laravel scout index files.
Only loading MailEclipse drops the indexes to im 100% sure it has something to do with this.
Any ideas?
Reproduction steps
Steps to reproduce the behavior:
Laravel Version:
8.77
MailEclipse package version:
v3.5.3
The text was updated successfully, but these errors were encountered: