-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
[2.3.2] consecutive _real() calls return different objects #808
Comments
Hi @KDederichs
absolutely not I'm trying to reproduce your problem, but I don't find how Could you elaborate, please? |
@nikophil I PR'd you a failing test case |
perfect! |
Oh btw, it's the same code snipped that gave you this gem: Dunno if it's in any way related, just in case you're wondering why I use _real() there.... |
#710 is a bug that we cannot fix for now, and I think we will never be able to fix. One of the stuff that makes me says that we should drop this whole proxy system that creates more problems than it fixes 🤷
I'm looking forward to it, I'm still not capable to reproduce your problem |
Oh I think there's a miscommunication here, when I said that I actually DID PR you the test case (to your test repo) |
haha ok, that's how I did understand your sentence, but this never come up in my notifications 🤷 I'll check this really soon |
yeah Github has been a bit inconsistent with notifications the last week or so I feel... |
@KDederichs hum ok, it is a Still, I cannot reproduce: https://github.com/zenstruck/foundry/pull/809/files could you make my new test fail? (please do it in this repo, no problem to add another PR) |
Sure, I'll probably have to bother github workers to see if fails though, locally I'm getting this very strange error, no clue why:
|
hey @KDederichs about the problem with phpunit: how do you run your tests? We have a about your initial problem: I think it comes from autorefresh behavior of the proxies: We usually have a check for this: if there is a modification in you object, it should not autorefresh, but here the modification is related to a relationship, and it appears that the unit of work does not sees it as a modification, so to allows the autorefresh. I'm wondering if we should not disable autorefresh when calling For now, I think you can do something like: $boxSubscription = $boxSubscription->_real()
$boxSubscription->addApplicationPdf(base64_decode(SignatureFixture::BASE64));
$boxSubscription->addKvForm(base64_decode(SignatureFixture::BASE64));
save($boxSubscription) and keep on using the unproxied object. |
Yeah I'm running the exact same code with 2.3.1 and version 2.2.2 with no issues for month now so I'm not sure why that's failing in your test suit :D Your workaround works fine for 2.3.3 though so I'll keep using that in the meantime, thanks! |
ok that's cool
ok, I'll have a look at some point 😅 |
Like the title says, since 2.3.2 calling _real() multiple times returns a different object every time.
This used to work in 2.3.1 but starting from 2.3.2 only the second element is contained in the collection, prompting me to believe I get a new 'real' object every time I call it.
Is that intended? I'd assume it should always return the same real instance of the entity
The text was updated successfully, but these errors were encountered: