Skip to content

@type property on mercure's 'delete' message#2688

Merged
alanpoulain merged 2 commits into
api-platform:mainfrom
toriqo:2.4
Jan 4, 2023
Merged

@type property on mercure's 'delete' message#2688
alanpoulain merged 2 commits into
api-platform:mainfrom
toriqo:2.4

Conversation

@toriqo

@toriqo toriqo commented Apr 4, 2019

Copy link
Copy Markdown
Contributor

return the type so a client subscribed to more than one topic will know which resource type was deleted without having to parse the @id

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

@toriqo toriqo changed the title @type @type property on mercure's 'delete' message Apr 4, 2019
@toriqo

toriqo commented Apr 4, 2019

Copy link
Copy Markdown
Contributor Author

ping @dunglas @soyuka @antograssiot

@soyuka soyuka 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.

I'm 👍 for the change but let's see what @dunglas has to say about this before merging.

Comment thread src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php Outdated

@dunglas dunglas 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.

Nice addition. Just a minor change to do. Thanks for this feature!

Comment thread src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php Outdated
@soyuka soyuka requested review from antograssiot and dunglas and removed request for dunglas April 8, 2019 14:50
@soyuka

soyuka commented Sep 30, 2019

Copy link
Copy Markdown
Member

needs to target master

@norkunas

Copy link
Copy Markdown
Contributor

This could be useful.. @toriqo are you up to finish this?

@bpolaszek

Copy link
Copy Markdown
Contributor

Just saying: the only way, client side, to know that a Mercure update is a removal instead of an update, is that you only have the @id property in the payload, right?

If so, why not considering this as a BC break?

(I 100% agree with adding the @type, that's not my point)

@divine

divine commented Nov 13, 2021

Copy link
Copy Markdown
Contributor

Hello,

I do really hope this will be a priority before the next major release. It's a needed feature that has been delayed for a few years.

@dunglas @soyuka does it needs only rebasing or something is left? Should I try to take care of it?

Thanks!

@dunglas

dunglas commented Nov 13, 2021

Copy link
Copy Markdown
Member

This just needs a rebase, and a decision about @id. I also fear that it's a BC break. I would suggest not setting it, or at least using a configuration option such as include_id under the mercure key.

@bpolaszek

Copy link
Copy Markdown
Contributor

This just needs a rebase, and a decision about @id. I also fear that it's a BC break. I would suggest not setting it, or at least using a configuration option such as include_id under the mercure key.

You mean @type and include_type, right?

@dunglas

dunglas commented Nov 14, 2021

Copy link
Copy Markdown
Member

Indeed.

@stale

stale Bot commented Nov 4, 2022

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix label Nov 4, 2022
@stale

stale Bot commented Jan 3, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Jan 3, 2023
@bpolaszek

Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Let's add a coin in the juke box - wasn't it just a minor change?

@stale stale Bot removed the stale label Jan 4, 2023
A client subscribed to more than one topics will know which resource type was deleted without having to parse the @id.
@alanpoulain alanpoulain changed the base branch from 2.4 to main January 4, 2023 10:26
@alanpoulain

Copy link
Copy Markdown
Member

I've picked this one. WDYT @bpolaszek?

@bpolaszek

Copy link
Copy Markdown
Contributor

I've picked this one. WDYT @bpolaszek?

Sounds 👌

@alanpoulain

Copy link
Copy Markdown
Member

Let's merge it then. It will be available in 3.1. Thanks everyone.

@alanpoulain alanpoulain merged commit e5f1be0 into api-platform:main Jan 4, 2023
BacLuc added a commit to BacLuc/ecamp3 that referenced this pull request May 6, 2023
Fixes:
585x: Since api-platform/core 3.1: Having mercure.include_type (always include @type in Mercure updates, even delete ones) set to false in the configuration is deprecated. It will be true by default in API Platform 4.0.
    4x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    4x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    4x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    4x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    4x in CreateMultiSelectTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MultiSelect

See api-platform/core#2688
usu pushed a commit to ecamp/ecamp3 that referenced this pull request May 12, 2023
Fixes:
585x: Since api-platform/core 3.1: Having mercure.include_type (always include @type in Mercure updates, even delete ones) set to false in the configuration is deprecated. It will be true by default in API Platform 4.0.
    4x in CreateColumnLayoutTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    4x in UpdateColumnLayoutTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\ColumnLayout
    4x in CreateMaterialNodeTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    4x in UpdateMaterialNodeTest::testPatchRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MaterialNode
    4x in CreateMultiSelectTest::testCreateRejectsParentsWhichDontSupportChildren from App\Tests\Api\ContentNodes\MultiSelect

See api-platform/core#2688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants