Skip to content

Conversation

@nikophil
Copy link
Member

@nikophil nikophil commented Oct 20, 2025

fixes #1009

/** @param \Closure():self|self $configuration */
public static function boot(\Closure|self $configuration): void
{
PersistedObjectsTracker::reset();
Copy link
Member Author

Choose a reason for hiding this comment

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

culprit was here

Choose a reason for hiding this comment

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

Hello !
Looks like this change has side effect :

class FooTest extends WebTestCase
{
    use Factories;

    public function testFoo(): void
    {
        FooFactory::create();
    }
}

gives us

Error: Typed static property Zenstruck\Foundry\Persistence\Proxy\PersistedObjectsTracker::$buffer must not be accessed before initialization
/var/www/project/vendor/zenstruck/foundry/src/Persistence/Proxy/PersistedObjectsTracker.php:53
/var/www/project/vendor/zenstruck/foundry/src/Persistence/PersistenceManager.php:89
/var/www/project/vendor/zenstruck/foundry/src/Persistence/PersistentObjectFactory.php:266
/var/www/project/tests/Functional/FooTest.php:7

Is there anything special to do to initialize foundry with this new version ?

@nikophil nikophil force-pushed the fix/auto-refresh-after-kernel-shutdown branch from c1b9ccb to e666d2b Compare October 20, 2025 16:33
@nikophil nikophil mentioned this pull request Oct 20, 2025
@nikophil nikophil merged commit 95d2a96 into zenstruck:2.x Oct 20, 2025
73 checks passed
@nikophil nikophil deleted the fix/auto-refresh-after-kernel-shutdown branch October 20, 2025 16:39
@Kocal
Copy link
Contributor

Kocal commented Oct 21, 2025

Hey!

I'm sorry for posting here, but it looks like this releases broke the Symfony UX tests-suite (https://github.com/symfony/ux/actions/runs/18675203003/job/53243634658?pr=3145), the test https://github.com/symfony/ux/blob/cd4dbe384bb4338a6ff9f384fdc6df7543e53db5/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php#L46-L73 is not passing anymore:

1) Symfony\UX\LiveComponent\Tests\Functional\EventListener\LiveComponentSubscriberTest::testCanRenderComponentAsHtml
Error: Typed static property Zenstruck\Foundry\Persistence\Proxy\PersistedObjectsTracker::$buffer must not be accessed before initialization

/home/runner/work/ux/ux/src/LiveComponent/vendor/zenstruck/foundry/src/Persistence/Proxy/PersistedObjectsTracker.php:53
/home/runner/work/ux/ux/src/LiveComponent/vendor/zenstruck/foundry/src/Persistence/PersistenceManager.php:89
/home/runner/work/ux/ux/src/LiveComponent/vendor/zenstruck/foundry/src/Persistence/PersistentObjectFactory.php:266
/home/runner/work/ux/ux/src/LiveComponent/vendor/zenstruck/foundry/src/Persistence/functions.php:89
/home/runner/work/ux/ux/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php:49

Do you know what can happens?
Thanks!

@nikophil
Copy link
Member Author

nikophil commented Oct 21, 2025

hi @Kocal

I won't be able to fix this today 😬

Please add a conflict on this version in you repo, I'll fix this tomorrow

@Kocal
Copy link
Contributor

Kocal commented Oct 21, 2025

No problem, at least you know.
Thanks! :)

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Objects not refreshing

3 participants