QUOTA_EXCEEDED is not mapped to TooManyRequestsError, so rate limiting arrives untyped
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia in response_handler.py, nelle tre mappe degli errori e in check_response, prestando particolare attenzione alla mappatura esistente di TooManyRequestsError intorno alla riga 60. Riproduci il caso FakeResp dell’issue, quindi verifica che una risposta QUOTA_EXCEEDED sollevi TooManyRequestsError invece del generico OverkizError. Il lavoro è concluso quando la risposta effettiva di limitazione della frequenza è tipizzata in modo coerente con il percorso di back-off previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 The problem
The Overkiz cloud reports its polling quota with errorCode: QUOTA_EXCEEDED, which matches none of the three error maps in response_handler.py, so it falls through to the generic raise at the end of check_response:
pyoverkiz.exceptions.OverkizError: {'errorCode': 'QUOTA_EXCEEDED', 'error': 'Too many requests, try again later'}
TooManyRequestsError is only reachable for a different errorCode (response_handler.py:60):
("AUTHENTICATION_ERROR", "Too many requests", TooManyRequestsError),
So the one exception type that means "you are being rate limited" is never raised for the server's actual rate-limit response.
🔁 Reproduction
import asyncio
from pyoverkiz.response_handler import check_response
from pyoverkiz.exceptions import OverkizError, TooManyRequestsError
class FakeResp:
status = 403
url = "https://example/events/x/fetch"
async def json(self, content_type=None):
return {"errorCode": "QUOTA_EXCEEDED",
"error": "Too many requests, try again later"}
async def main():
try:
await check_response(FakeResp())
except TooManyRequestsError:
print("typed")
except OverkizError as err:
print("untyped:", err)
asyncio.run(main()) # -> untyped: {'errorCode': 'QUOTA_EXCEEDED', ...}
Why none of the maps catch it:
_ERROR_CODE_MESSAGE_MAP(:47) — has noQUOTA_EXCEEDEDentry_MESSAGE_FALLBACK_MAP(:104) — has"Too many executions"and"Too many attempts with an invalid token", but not"Too many requests"_ERROR_CODE_FALLBACK_MAP(:121) — onlyAUTHENTICATION_ERRORandRESOURCE_ACCESS_DENIED
📉 Why it matters
Callers cannot distinguish rate limiting from an unknown server error without string-matching the payload, so any back-off keyed on TooManyRequestsError silently never runs.
Measured on an Atlantic Cozytouch V2 hub (cloud API), eight commands issued in parallel to eight heaters, Home Assistant's overkiz integration:
| observed | |
|---|---|
fetch_events rate during the burst |
1.32 /s (documented limit: 1/s) |
| polling intervals under 1 s | 5, shortest 0.23 s |
QUOTA_EXCEEDED raised |
1 |
| commands that reached the hub | 5 / 8 |
Because the error arrives untyped:
- it surfaces as
Unexpected error fetching device events datawith a full traceback, rather than a handled rate-limit path - the coordinator keeps polling at the interval that hit the limit instead of slowing down
- the failed update marks every entity
unavailable, and Home Assistant then refuses the remaining service calls —Referenced entities ... are missing or not currently available— so three commands were silently dropped - worst state-delivery lag in that run was 28.97 s
✅ Suggested fix
Either map the code directly in _ERROR_CODE_MESSAGE_MAP:
("QUOTA_EXCEEDED", None, TooManyRequestsError),
…or, more robustly, add the message to _MESSAGE_FALLBACK_MAP so it matches whatever errorCode carries it:
("Too many requests", TooManyRequestsError),
The second also covers the existing AUTHENTICATION_ERROR variant, and any future code the cloud attaches to the same message.
🧾 Environment
pyoverkiz2.1.0- Hub: Atlantic Cozytouch V2 (
io://****-****-9776), cloud API — local API not available for this server - Seen on the
events/{listener_id}/fetchendpoint, documented as "1 calls per 1 SECONDS period for this particular operation (polling)"
Happy to open a PR for whichever form you prefer.
- Lingua principale
- Python
- Stelle
- 58
- Fork
- 35
- Merge medio
- 3g 15h
- PR unite (30g)
- 20
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di iMicknl/python-overkiz-api
-
blocked feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
iMicknl/python-overkiz-api#1525 · 5 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di iMicknl/python-overkiz-api
Issue simili
-
ACK_WAITING HELP_WANTED UPDATE_CS
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OWASP/CheatSheetSeries#2458 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
BasedHardware/omi#19711 ·
I maintainer di solito rispondono entro 1 giorno
-
Qwen3_5MoeModel no longer returns router_logits, breaking aux loss with output_router_logits=TrueAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
huggingface/transformers#49172 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vllm-project/vllm-metal#885 ·
I maintainer di solito rispondono entro 1 giorno