Skip to content

add random_id optional parameter to send_message method to ensure idempotency #70

@d3cryptofc

Description

@d3cryptofc

Checklist

  • I believe the idea is awesome and would benefit the framework
  • I have searched in the issue tracker for similar requests, including closed ones

Description

When working with messaging services, it is crucial that listeners have idempotent logic, which ensures that no operations will be duplicated if the service fails and tries to reprocess.

MTProto has a parameter where you can define an ID, which will ensure that the message is sent only once:

random_id long
"Unique client message ID required to prevent message resending"

https://core.telegram.org/method/messages.sendMessage

It exists in the raw functions, but the abstraction that wraps it doesn't have a parameter that we can pass to it:

Alternatively I am calling the raw function directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, request or code enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions