Skip to content
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

[bug] /api/v1/conversations returns incomplete accounts property in Conversation object #3385

Closed
nikclayton opened this issue Oct 4, 2024 · 2 comments · Fixed by #3387
Closed
Labels
bug Something isn't working

Comments

@nikclayton
Copy link

Describe the bug with a clear and concise description of what the bug is.

/api/v1/conversations returns an array of Conversation. Each Conversation has an accounts property, which is a list of the accounts of the participants in the conversation.

This property omits the account of the current user. It shouldn't -- the current user should always be included.

What's your GoToSocial Version?

3.5.3+0.17.0-SNAPSHOT+git-713e733

GoToSocial Arch

Don't know, I'm not the server admin

What happened?

Make API request to /api/v1/conversations with an authenticated token for an account that has conversations. Inspect the result, and see that the user's account is missing from the accounts property.

What you expected to happen?

Each Conversation's accounts property should always contain the user's account, plus the other accounts in the conversation.

How to reproduce it?

  • Create a direct message, don't mention any other users. Send it.
  • Fetch the user's list of conversations using the API
  • Verify the accounts property is an empty list

If you do this and do mention any other users you can also verify that the sending account is not in the accounts property.

Anything else we need to know?

Stock Mastodon appears to return the user's account in the accounts property, so it is always non-empty.

Reported by a Pachli user in pachli/pachli-android#971

@nikclayton nikclayton added the bug Something isn't working label Oct 4, 2024
@tsmethurst
Copy link
Contributor

On Mastodon v3.5.19, the requesting account (ie., the account viewing the conversation) does not seem to be included in the accounts property. Did this change in 4.x.x of Mastodon?

@tsmethurst
Copy link
Contributor

Hmm OK I see, I just tested on mastodon.social (v4.3.0-rc.1+pr-32223-dccfe46) and the behavior seems to be:

  • If it's just a conversation with a message you've sent to yourself, your account will be included in 'accounts'.
  • If it's a conversation with messages including other accounts, your account will not be included in 'accounts', the other accounts will be instead.

So indeed the 'accounts' property should not be empty, but it shouldn't always contain your own account either. I'll make a PR to add the requesting account to the accounts property if there are no other accounts involved in the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants