|
| 1 | +`9.0.5 (2025-12-12) <https://github.com/neos/flow-development-collection/releases/tag/9.0.5>`_ |
| 2 | +============================================================================================== |
| 3 | + |
| 4 | +Overview of merged pull requests |
| 5 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 6 | + |
| 7 | +`BUGFIX: Prevent premature connection to database before `PersistenceManager::persistAllowedObjects` <https://github.com/neos/flow-development-collection/pull/3489>`_ |
| 8 | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 9 | + |
| 10 | +For every simple GET request ``persistAllowedObjects`` is called via the Package.php in flow. This results in building a db connection, even if there is nothing to do. |
| 11 | + |
| 12 | +We first check if the ``entityManager`` is open and if the entity manager has not been used (something is heavily cached via middle-ware or sth) flows objectmanagement retrieves the entity manger. |
| 13 | + |
| 14 | +Now in this retrieval process - even though doctrines connection is lazy itself - the connection will be made forcefully see ``\\Neos\\Flow\\Persistence\\Doctrine\\EntityManagerFactory::create`` line 120 (https://github.com/neos/flow-development-collection/blob/`11e2348125dd8286ff9ccc088e5d187dc9143bf5 <https://github.com/neos/flow-development-collection/commit/11e2348125dd8286ff9ccc088e5d187dc9143bf5>``_/Neos.Flow/Classes/Persistence/Doctrine/EntityManagerFactory.php#L120) or https://github.com/neos/flow-development-collection/blob/``d93b6b09ca2071c87812a9ef4bc120201c44608a <https://github.com/neos/flow-development-collection/commit/d93b6b09ca2071c87812a9ef4bc120201c44608a>`_/Neos.Flow/Classes/Persistence/Doctrine/EntityManagerConfiguration.php#L229 |
| 15 | +
|
| 16 | +This is ironic because if there is no connection - or no entity manager in the first place, the current process cannot have made any changes to the transaction. |
| 17 | +
|
| 18 | +**Upgrade instructions** |
| 19 | +
|
| 20 | +
|
| 21 | +* Packages: ``.github`` ``Eel`` ``Flow`` |
| 22 | + |
| 23 | +`BUGFIX: `configuration:show` with non array value crashing when accesed via `--path` <https://github.com/neos/flow-development-collection/pull/3501>`_ |
| 24 | +------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 25 | + |
| 26 | + |
| 27 | +fixup like https://github.com/neos/flow-development-collection/pull/3483 |
| 28 | + |
| 29 | +a bool for example |
| 30 | + |
| 31 | +``` |
| 32 | +flow configuration:show --path Neos.Neos.Ui.frontendDevelopmentMode |
| 33 | +``` |
| 34 | + |
| 35 | +should output ``true`` |
| 36 | + |
| 37 | +but |
| 38 | + |
| 39 | +> Neos\\Flow\\Command\\ConfigurationCommandController_Original::truncateArrayAtDepth(): Argument `#1 <https://github.com/neos/flow-development-collection/issues/1>`_($array) must be of type array, true given |
| 40 | + |
| 41 | +**Upgrade instructions** |
| 42 | + |
| 43 | + |
| 44 | +* Packages: ``FluidAdaptor`` ``Flow`` |
| 45 | + |
| 46 | +`BUGFIX: Avoid passing null to strtolower() <https://github.com/neos/flow-development-collection/pull/3525>`_ |
| 47 | +------------------------------------------------------------------------------------------------------------- |
| 48 | + |
| 49 | +Avoids ``Deprecated: strtolower(): Passing null to parameter ``#1 <https://github.com/neos/flow-development-collection/issues/1>``_($string) of type string is deprecated`` warnings, in case the arguments have not been set. |
| 50 | + |
| 51 | + |
| 52 | +* Packages: ``FluidAdaptor`` |
| 53 | + |
| 54 | +`BUGFIX: Fix race condition during log rotation -> the `.lock` file is not properly locked <https://github.com/neos/flow-development-collection/pull/3521>`_ |
| 55 | +------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 56 | + |
| 57 | +See https://discuss.neos.io/t/unlink-system-development-log-10-no-such-file/7140/2 |
| 58 | + |
| 59 | +Multiple processes writing logs can easily run into the following error when its time to rotate the logs: |
| 60 | + |
| 61 | +``` |
| 62 | +Warning: rename(Data/Logs/System_Development.log.3,Data/Logs/System_Development.log.4): No such file or directory in Packages/Framework/Neos.Flow.Log/Classes/Backend/FileBackend.php line 217 |
| 63 | + |
| 64 | + Type: Neos\\Flow\\Error\\Exception |
| 65 | + Code: 1 |
| 66 | + File: Packages/Framework/Neos.Flow/Classes/Error/ErrorHandler.php |
| 67 | + Line: 80 |
| 68 | +``` |
| 69 | + |
| 70 | +During log rotation we attempt to use a lock via ``file_exists`` but its not an atomic operation how we use it https://github.com/neos/flow-development-collection/blob/`54cea0a2cafb9ee1475ae2fdbc1fd3a1830ddc86 <https://github.com/neos/flow-development-collection/commit/54cea0a2cafb9ee1475ae2fdbc1fd3a1830ddc86>``_/Neos.Flow.Log/Classes/Backend/FileBackend.php#L194-L198 ``file_exists`` could be true for two processes at the same time in a race condition and both processes would ``touch` (create) the lock file. |
| 71 | +
|
| 72 | +Instead, we need to use a atomic locking via ``flock`` |
| 73 | + |
| 74 | +``` |
| 75 | +$lockResource = fopen($this->logFileUrl . '.lock', 'w+'); |
| 76 | + |
| 77 | +$exclusiveNonBlockingLockResult = flock($lockResource, LOCK_EX | LOCK_NB); |
| 78 | +if ($exclusiveNonBlockingLockResult === false) { |
| 79 | + // someone else is on it |
| 80 | + return; |
| 81 | +} |
| 82 | + |
| 83 | +// do something only this process is supposed to do... |
| 84 | + |
| 85 | +if (!flock($setupLockResource, LOCK_UN)) { |
| 86 | + throw new \\RuntimeException('failed to release lock'); |
| 87 | +} |
| 88 | +``` |
| 89 | + |
| 90 | +Tested on MacOs with 3 simultaneous shells running each a flow command that writes logs in a shell while loop. |
| 91 | + |
| 92 | +I hope windows supports ``flock($lockResource, LOCK_EX | LOCK_NB);`` to exclusively claim a lock without waiting for it if its claimed. |
| 93 | + |
| 94 | +**Upgrade instructions** |
| 95 | + |
| 96 | + |
| 97 | +* Packages: ``Flow.Log`` |
| 98 | + |
| 99 | +`BUGFIX: Check also for SkipCsrfProtection annotation <https://github.com/neos/flow-development-collection/pull/3520>`_ |
| 100 | +----------------------------------------------------------------------------------------------------------------------- |
| 101 | + |
| 102 | +We currently check only for the "tag" ``@skipcsrfprotection``, any (action) method annotated with ``@Flow\\SkipCsrfProtection`` is only part of the times handled correctly. |
| 103 | + |
| 104 | +Attributes ``#[Flow\\SkipCsrfProtection]`` or an annotation with comment on the same line ``@Flow\\SkipCsrfProtection Some explanation`` are not handled currently. |
| 105 | + |
| 106 | +Obviously this is not intended, rather using the tag should be avoided. |
| 107 | + |
| 108 | +This adds the check for reflected annotations/attributes. |
| 109 | + |
| 110 | +**Review instructions** |
| 111 | + |
| 112 | +The root cause for this behaviour is that we just never used ``isAnnotatedWith`` but only relied on ``isTaggedWith`` to interpret if a method is tagged. The tagging parsing is custom done via ``DocCommentParser`` and utterly broken https://github.com/neos/flow-development-collection/pull/3520#issuecomment-3518076068 in that it attempts to convert annotations to tags by dropping the namespace but only if no comments exist on that line. |
| 113 | + |
| 114 | +* Packages: ``Flow`` |
| 115 | + |
| 116 | +`TASK: Add missing symfony polyfill replacements due to php82 version <https://github.com/neos/flow-development-collection/pull/3531>`_ |
| 117 | +--------------------------------------------------------------------------------------------------------------------------------------- |
| 118 | + |
| 119 | +This change might need adjustments if one has a composer ``replacement`` in ones distribution as flow failed to provide it earlier. Updating could then cause a conflict as composer - i believe - only respects one replace directive to exist per package. |
| 120 | + |
| 121 | +**Upgrade instructions** |
| 122 | + |
| 123 | +Remove these replacements in your own composer.json |
| 124 | + |
| 125 | + |
| 126 | +`TASK: Run pipeline with PHP8.5 <https://github.com/neos/flow-development-collection/pull/3527>`_ |
| 127 | +------------------------------------------------------------------------------------------------- |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | +* Packages: ``Flow`` ``.github`` ``Eel`` |
| 132 | + |
| 133 | +`Detailed log <https://github.com/neos/flow-development-collection/compare/9.0.4...9.0.5>`_ |
| 134 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
0 commit comments