Skip to content

Random "Bad Request: PARTICIPANT_ID_INVALID" errors with getChatMember and banChatMember #802

@php4fan

Description

@php4fan

I sometimes randomly get a bogus error

Bad Request: PARTICIPANT_ID_INVALID

when doing getChatMember requests with user_id and chat_id that are definitely valid.

Then, often, an identical request for the exact same {user_id, chat_id} pair, done a bit later, returns left.

Note that "PARTICIPANT_ID_INVALID" is not even a well-formed error message. Error messages from the API are normally full English sentences. This looks like some internal identifier string that you forgot to map to a proper error message.

But even if it said "Participant ID invalid", it still makes no sense. The user ID is valid, and it's a user that exists. If there's a legitimate reason for not being able or allowed to get the user's chat member status, the error message should say exactly what the reason is.

BTW The phrase "participant ID" doesn't mean anything from a client perspective. There's no concept of a "participant id" anywhere in the API documentation. If it meant "user ID" it should say so; if it's the {user_id, chat_id} pair that constitutes a "participant ID" for you, then again, it should say something like "Invalid {user ID, chat ID} pair" or similar.

Also, if there's a legitimate reason for the bot not being able to get the chat member status of a particular user (that exists) in a particular chat (that exists), I can't think of anything that wouldn't be better described by a "Forbidden" response than a "Bad request" response.

Anyway, the most important thing is that PARTICIPANT_ID_INVALID means nothing, and doesn't sufficiently describe what the reason for the error is, especially when the exact same request returns a result a few minutes later.

This is not #795 and this one is seemingly random.

I also sometimes get the same error message in response to banChatMember requests, but I'm still investigating those. Those do not seem to go away randomly. At first I thought that was the expected behavior (except for the poor error message) when trying to ban a user from a chat they've never been in, but I have verified that that is not always the case. At least in some cases, banning a user from a chat where they've never been, succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions