8000 [Notifier] [BlueSky] Change the value returned as the message ID by javiereguiluz · Pull Request #59742 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Notifier] [BlueSky] Change the value returned as the message ID #59742

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 click 8000 ing “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
Feb 11, 2025

Conversation

javiereguiluz
Copy link
Member
Q A
Branch? 7.2
Bug fix? yes
New feature? no
Deprecations? no
Issues #59739
License MIT

Some BlueSky API actions require both the cid and the uri (see https://docs.bsky.app/docs/tutorials/like-repost) so we might re-add the cid to SentMessage's info in Symfony 7.3.

@javiereguiluz javiereguiluz added this to the 7.2 milestone Feb 10, 2025
@carsonbot carsonbot changed the title [Notifier][BlueSky] Change the value returned as the message ID [Notifier] [BlueSky] Change the value returned as the message ID Feb 10, 2025
@alexandre-daubois
Copy link
Member
alexandre-daubois commented Feb 10, 2025

This snippet can be added to BlueSkyTransportTest to validate the fix:

public function testUriIsSetAsMessageId()
{
    $client = new MockHttpClient(function () {
        return new JsonMockResponse([
            'uri' => 'https://example.com',
            'cid' => 'my_cid',
        ]);
    });

    $transport = self::createTransport($client);
    $message = $transport->send(new ChatMessage('Hello!'));

    $this->assertSame('https://example.com', $message->getMessageId());
}

@javiereguiluz
Copy link
Member Author

Alex, thanks a lot for creating the test for this 🙏

I only changed the values of the uri/cid to make them a bit more realistic because the BlueSky URI uses an uncommon format and it's better to test that too. Thanks.

@@ -5,6 +5,7 @@ CHANGELOG
---

* Add option to attach a media
* [BC Break] Change the returned message ID from record's 'cid' to 'uri'
Copy link
Member

Choose a reason for hiding this comment

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

Should be reverted as changelogs are auto-updated for bugfixes

Copy link
Member

Choose a reason for hiding this comment

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

Only the main CHANGELOG. Here, we want to signify something unusual, I think it's fine.

Copy link
Member

Choose a reason for hiding this comment

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

Fine for me as well, but I think it's worth noticing that we had similar discussions in the past and the conclusion was it's either a bugfix or a BC break, not both.

@nicolas-grekas
Copy link
Member

Thank you @javiereguiluz.

@nicolas-grekas nicolas-grekas merged commit 6262b65 into symfony:7.2 Feb 11, 2025
6 checks passed
@javiereguiluz javiereguiluz deleted the fix_59739 branch February 11, 2025 07:41
nicolas-grekas added a commit that referenced this pull request Feb 18, 2025
…al info (javiereguiluz)

This PR was squashed before being merged into the 7.3 branch.

Discussion
----------

[Notifier] [Bluesky] Return the record CID as additional info

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

Some Bluesky API operations (like replies and quotes) require "strong references", which is the combination of the `uri` and the `cid` (See https://docs.bsky.app/docs/advanced-guides/posts#replies-quote-posts-and-embeds).

After the changes made in #59742, we should also return the `cid` as additional info.

Commits
-------

85a073e [Notifier] [Bluesky] Return the record CID as additional info
@fabpot fabpot mentioned this pull request Feb 26, 2025
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.

7 participants
0