matrix-org / matrix-org/matrix-python-sdk

No rate limiting

Open
#6 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Api layer architecture enhancement
Dominant language
Python
Stars
266
Forks
118
PR merge metrics
No merged PRs in 30d

Description

~/Projects/mcat $ cat mcat.py | env/bin/python mcat.py --room "!CJDvntNEPGQmykeIrB:whatthefuck.computer" --stdin -c ~/.mcatrc 
Traceback (most recent call last):
  File "mcat.py", line 55, in <module>
    mcat.f_to_matrix(sys.stdin)
  File "mcat.py", line 24, in f_to_matrix
    self.room.send_text(line)
  File "/home/rrix/Projects/mcat/env/lib/python2.7/site-packages/matrix_client/client.py", line 169, in send_text
    return self.client.api.send_message(self.room_id, text)
  File "/home/rrix/Projects/mcat/env/lib/python2.7/site-packages/matrix_client/api.py", line 194, in send_message
    self.get_text_body(text_content, msgtype)
  File "/home/rrix/Projects/mcat/env/lib/python2.7/site-packages/matrix_client/api.py", line 183, in send_message_event
    return self._send("PUT", path, content)
  File "/home/rrix/Projects/mcat/env/lib/python2.7/site-packages/matrix_client/api.py", line 319, in _send
    code=response.status_code, content=response.text
matrix_client.api.MatrixRequestError: 429: {"errcode":"M_LIMIT_EXCEEDED","error":"Too Many Requests","retry_after_ms":1214}

The javascript SDK implements a fairly complex queuing system, I'm going to strawman something similar to that, shortly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the send path shown in matrix_client/api.py, especially send_message_event and _send, and compare it with the linked matrix-js-sdk scheduler. The issue's traceback shows Matrix rate-limit responses with retry_after_ms; done would require an agreed queuing or retry design that handles these responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.