Skip to content

Remove stack of envelope classes from message metadata#289

Open
vjik wants to merge 3 commits into
masterfrom
no-envelope-deserialization
Open

Remove stack of envelope classes from message metadata#289
vjik wants to merge 3 commits into
masterfrom
no-envelope-deserialization

Conversation

@vjik
Copy link
Copy Markdown
Member

@vjik vjik commented May 21, 2026

Q A
Is bugfix?
New feature?
Breaks BC? ✔️
Tests pass? ✔️

@vjik vjik requested a review from a team May 21, 2026 17:36
@vjik vjik added the status:code review The pull request needs review. label May 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (0c9c1fd) to head (74caa6a).

Files with missing lines Patch % Lines
src/Message/Envelope.php 0.00% 1 Missing ⚠️
src/Message/JsonMessageSerializer.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             master    #289   +/-   ##
========================================
  Coverage      0.00%   0.00%           
+ Complexity      326     318    -8     
========================================
  Files            48      48           
  Lines           892     872   -20     
========================================
+ Misses          892     872   -20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vjik vjik changed the title Stop wrapping messages in envelopes during deserialization Remove envelopes' classes stack from message metadata May 22, 2026
@vjik vjik changed the title Remove envelopes' classes stack from message metadata Remove stack of envelope classes from message metadata May 22, 2026
@vjik vjik requested a review from Copilot May 22, 2026 08:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the “envelope stack” concept from message metadata and stops JSON deserialization from reconstructing envelope wrappers based on metadata, aligning message handling around plain messages + explicit metadata keys (BC-breaking change as noted in the PR description).

Changes:

  • Removed envelope stack tracking from Envelope metadata (no more envelopes key management).
  • Simplified JsonMessageSerializer::unserialize() to return the message class directly without rebuilding envelope wrappers.
  • Updated unit tests to reflect the new serialization/unserialization behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Message/Envelope.php Stops injecting/maintaining an “envelope stack” in metadata; now only merges base + envelope metadata.
src/Message/JsonMessageSerializer.php Removes logic that read an envelope stack from metadata and re-wrapped messages during unserialize().
tests/Unit/Message/JsonMessageSerializerTest.php Updates expectations so unserialization returns plain Message and metadata no longer includes an envelope stack.
tests/Unit/Message/EnvelopeTest.php Removes tests that validated envelope stack normalization/behavior.
tests/Unit/EnvelopeTest.php Removes assertions that depended on the envelope stack metadata key.
Comments suppressed due to low confidence (1)

tests/Unit/Message/JsonMessageSerializerTest.php:141

  • Outdated type annotation: the docblock claims $message is IdEnvelope, but the test now asserts it is a Message. This can mislead static analysis and readers; update or remove the annotation.
        /** @var IdEnvelope $message */
        $message = $serializer->unserialize(json_encode($payload, JSON_THROW_ON_ERROR));

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Message/JsonMessageSerializer.php
Comment thread tests/Unit/Message/JsonMessageSerializerTest.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants