Skip to content

[Notifier] Fix thread key in GoogleChat bridge #57384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

romain-jacquart
Copy link
Contributor

@romain-jacquart romain-jacquart commented Jun 12, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #57323
License MIT

Hello,

Google Chat API has deprecated the use of threadKey query parameter in favor of thread.threadKey in request's body.

In order for the thread key value to not be ignored, a new query parameter messageReplyOption has been added which controls the way the key is handled.
I chose not to expose the values used by this new parameter as I wanted to focus this PR on the actual fix.
To do so, I've forced the value of messageReplyOption to REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD which replicates the original behavior of this bridge.

@OskarStark
Copy link
Contributor

Please target 7.2 branch for your PR as this is a new feature. thanks

@romain-jacquart
Copy link
Contributor Author

Please target 7.2 branch for your PR as this is a new feature. thanks

Hello, thanks for your reply.

This actually is not a new feature, since the thread key in query parameters has no effect now on the new Google Chat API. Shouldn't this qualifies as a bug and the fix be backported to 5.4?

@OskarStark
Copy link
Contributor

OskarStark commented Jun 13, 2024

It introduces new code to handle the new threadKey . So this should go into 7.2 with the deprecation and the deprecation layer be removed in 8.0.

Someone who needs this should upgrade to 7.2 then

@fabpot
Copy link
Member

fabpot commented Jun 15, 2024

I agree that this should go in 7.2.

@OskarStark OskarStark modified the milestones: 5.4, 7.2 Jun 15, 2024
@romain-jacquart romain-jacquart changed the base branch from 5.4 to 7.2 June 15, 2024 16:53
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

Thanks for catching this deprecation in the Google API.

This PR keeps the backward compatibility regarding the threadKey declaration (in DSN) and the GoogleChatOptions::setThreadKey() method.

I think this PR does too many things. We could just modify the HTTP request, and leave the options and methods untouched.

@romain-jacquart
Copy link
Contributor Author

This PR keeps the backward compatibility regarding the threadKey declaration (in DSN) and the GoogleChatOptions::setThreadKey() method.

I think this PR does too many things. We could just modify the HTTP request, and leave the options and methods untouched.

Thanks for your time reviewing this change.

I thought this was a good opportunity to update the options, but I guess this made too much noise around the actual fix.

@GromNaN
Copy link
Member

GromNaN commented Jun 18, 2024

Thanks for simplifying this PR. I think we can now consider it as a bugfix to guarantee compatibility with the Google API in the future and merge in 5.4 @symfony/mergers?

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

Works for me as a bug fix for 5.4.
@romain-jacquart Can you remove the CHANGELOG change and rebase on 5.4?

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

LGTM once rebased on 5.4

Google Chat API has deprecated the use of `threadKey` query parameter
in favor of `thread.threadKey` in request's body.
@romain-jacquart romain-jacquart changed the base branch from 7.2 to 5.4 June 18, 2024 22:04
@romain-jacquart
Copy link
Contributor Author

Works for me as a bug fix for 5.4. @romain-jacquart Can you remove the CHANGELOG change and rebase on 5.4?

The branch has been rebased on 5.4 and CHANGELOG changes have been removed 👍.

The rebase has introduced a slight change regarding a variable's name ($options vs $opts). Will it be a problem?

Thanks!

@fabpot fabpot modified the milestones: 7.2, 5.4 Jun 19, 2024
@fabpot
Copy link
Member

fabpot commented Jun 19, 2024

Thank you @romain-jacquart.

@fabpot fabpot merged commit 53a3024 into symfony:5.4 Jun 19, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Chat notifications not work properly with threads
5 participants