Skip to content

Add MissingHeaders if no header found#867

Merged
DanielBadura merged 2 commits into
3.20.xfrom
dont-crash-if-header-missing
Jun 30, 2026
Merged

Add MissingHeaders if no header found#867
DanielBadura merged 2 commits into
3.20.xfrom
dont-crash-if-header-missing

Conversation

@DanielBadura

@DanielBadura DanielBadura commented Jun 19, 2026

Copy link
Copy Markdown
Member

It is kinda BC-Break, as the behaviour is changing greatly.

Not sure if this is the right path, as the app could still try to load the original Header from the Message - and then it would still crash, but there we also have hasHeader so it is possible to handle it.

closes #818

@DanielBadura
DanielBadura requested a review from DavidBadura June 19, 2026 21:52
@DanielBadura DanielBadura self-assigned this Jun 19, 2026
@DanielBadura DanielBadura added enhancement New feature or request BC-Break labels Jun 19, 2026
@DanielBadura DanielBadura added this to the 4.0.0 milestone Jun 19, 2026
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Hello 👋

here is the most recent benchmark result:

SplitStreamBench
================

+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                         | time (kde mode)                                     | memory                                     |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                 | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad10000Events () | 5.185ms (±0.00%)   | 5.283ms (±0.00%)   | -1.87%    | 35.650mb        | 36.167mb   | -1.43%      |
| benchSave10000Events () | 337.494ms (±0.00%) | 339.753ms (±0.00%) | -0.66%    | 35.651mb        | 35.652mb   | -0.00%      |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SimpleSetupStreamStoreBench
===========================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.180ms (±0.00%)   | 1.165ms (±0.00%)   | +1.27%    | 35.206mb        | 35.206mb   | +0.00%      |
| benchLoad10000Events ()                | 72.401ms (±0.00%)  | 68.830ms (±0.00%)  | +5.19%    | 35.206mb        | 35.206mb   | +0.00%      |
| benchSave1Event ()                     | 1.406ms (±0.00%)   | 1.228ms (±0.00%)   | +14.45%   | 35.206mb        | 35.206mb   | +0.00%      |
| benchSave10000Events ()                | 299.769ms (±0.00%) | 290.929ms (±0.00%) | +3.04%    | 35.206mb        | 35.206mb   | +0.00%      |
| benchSave10000Aggregates ()            | 7.570s (±0.00%)    | 7.560s (±0.00%)    | +0.12%    | 35.206mb        | 35.206mb   | +0.00%      |
| benchSave10000AggregatesTransaction () | 4.933s (±0.00%)    | 4.882s (±0.00%)    | +1.05%    | 35.206mb        | 35.206mb   | +0.00%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SimpleSetupBench
================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.224ms (±0.00%)   | 1.029ms (±0.00%)   | +18.95%   | 34.979mb        | 34.979mb   | +0.00%      |
| benchLoad10000Events ()                | 63.167ms (±0.00%)  | 62.496ms (±0.00%)  | +1.07%    | 34.979mb        | 34.979mb   | +0.00%      |
| benchSave1Event ()                     | 1.278ms (±0.00%)   | 1.148ms (±0.00%)   | +11.32%   | 34.979mb        | 34.979mb   | +0.00%      |
| benchSave10000Events ()                | 221.795ms (±0.00%) | 224.078ms (±0.00%) | -1.02%    | 34.979mb        | 34.979mb   | +0.00%      |
| benchSave10000Aggregates ()            | 7.362s (±0.00%)    | 7.179s (±0.00%)    | +2.55%    | 34.979mb        | 34.979mb   | +0.00%      |
| benchSave10000AggregatesTransaction () | 4.743s (±0.00%)    | 4.733s (±0.00%)    | +0.20%    | 34.979mb        | 34.979mb   | +0.00%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBatchBench
============================

+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                   | memory                                     |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 86.035ms (±0.00%) | 81.217ms (±0.00%) | +5.93%    | 35.544mb        | 35.544mb   | +0.00%      |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

NoopSubscriptionEngineBench
===========================

+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                   | memory                                     |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 79.150ms (±0.00%) | 80.434ms (±0.00%) | -1.60%    | 47.560mb        | 47.560mb   | +0.00%      |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBench
=======================

+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                               | memory                                     |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>  | Tag: base       | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 3.216s (±0.00%) | 3.208s (±0.00%) | +0.25%    | 47.560mb        | 47.560mb   | +0.00%      |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+

CommandToQueryBench
===================

+----------------+------------------+------------------+-----------+-----------------+------------+-------------+
|                | time (kde mode)                                 | memory                                     |
+----------------+------------------+------------------+-----------+-----------------+------------+-------------+
| subject        | Tag: <current>   | Tag: base        | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------+------------------+------------------+-----------+-----------------+------------+-------------+
| benchCreate () | 2.789ms (±0.00%) | 2.550ms (±0.00%) | +9.35%    | 4.976mb         | 5.034mb    | -1.15%      |
| benchUpdate () | 4.271ms (±0.00%) | 4.212ms (±0.00%) | +1.41%    | 4.981mb         | 5.026mb    | -0.88%      |
| benchBoth ()   | 6.947ms (±0.00%) | 6.956ms (±0.00%) | -0.12%    | 5.024mb         | 5.074mb    | -0.99%      |
+----------------+------------------+------------------+-----------+-----------------+------------+-------------+

PersonalDataBench
=================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.467ms (±0.00%)   | 1.292ms (±0.00%)   | +13.51%   | 35.585mb        | 35.585mb   | +0.00%      |
| benchLoad10000Events ()                | 94.433ms (±0.00%)  | 91.073ms (±0.00%)  | +3.69%    | 35.585mb        | 35.585mb   | +0.00%      |
| benchSave1Event ()                     | 1.876ms (±0.00%)   | 1.748ms (±0.00%)   | +7.30%    | 35.585mb        | 35.585mb   | +0.00%      |
| benchSave10000Events ()                | 252.800ms (±0.00%) | 249.092ms (±0.00%) | +1.49%    | 35.586mb        | 35.586mb   | +0.00%      |
| benchSave10000Aggregates ()            | 11.498s (±0.00%)   | 11.621s (±0.00%)   | -1.06%    | 35.585mb        | 35.585mb   | +0.00%      |
| benchSave10000AggregatesTransaction () | 8.987s (±0.00%)    | 8.928s (±0.00%)    | +0.66%    | 36.044mb        | 36.044mb   | +0.00%      |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SnapshotsBench
==============

+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                   | memory                                     |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchLoad10000EventsMissingSnapshot () | 63.306ms (±0.00%) | 62.590ms (±0.00%) | +1.14%    | 35.049mb        | 35.049mb   | +0.00%      |
| benchLoad10000Events ()                | 1.105ms (±0.00%)  | 1.274ms (±0.00%)  | -13.21%   | 35.049mb        | 35.049mb   | +0.00%      |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

This comment gets update everytime a new commit comes in!

@DanielBadura
DanielBadura force-pushed the dont-crash-if-header-missing branch from f4fc2a2 to 05a0da1 Compare June 22, 2026 09:35
@DanielBadura DanielBadura changed the title Add MissingHeader if no header found Add MissingHeaders if no header found Jun 22, 2026

@DavidBadura DavidBadura left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That should be optional. There are headers that are business-critical (e.g., the tenant header). if one of those isn't serialized for some reason, I think it should crash.

It would be best to be able to specify which headers are allowed to be "missing", so if a header is no longer present, you simply list it. Or you could specify * to allow all of them. Like MissingApply.

That way, it wouldn't be a breaking change.

@DanielBadura
DanielBadura requested a review from DavidBadura June 28, 2026 13:52
Comment thread src/Message/Serializer/DefaultHeadersSerializer.php Outdated
@DavidBadura DavidBadura modified the milestones: 4.0.0, 3.20.0 Jun 30, 2026
@DavidBadura
DavidBadura changed the base branch from 4.0.x to 3.20.x June 30, 2026 06:11
@DanielBadura
DanielBadura force-pushed the dont-crash-if-header-missing branch 2 times, most recently from d00c62a to c5f436d Compare June 30, 2026 06:53
…the Registry cannot find the headers. It is a collection of missing Headers

Make the missing header configurable
Add * wildcard
@DanielBadura
DanielBadura force-pushed the dont-crash-if-header-missing branch from c5f436d to 4cc34a6 Compare June 30, 2026 07:27
@DanielBadura
DanielBadura merged commit 584f17b into 3.20.x Jun 30, 2026
37 of 39 checks passed
@DanielBadura
DanielBadura deleted the dont-crash-if-header-missing branch June 30, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to remove Header classes without crashes

2 participants