fix(adapter): CLARIFY-Trennzeichen-Bug — :: vs : zwischen clarify_id und choice
_build_custom_buttons() sendet Payloads mit :: (Doppel-Doppelpunkt),
aber _process_incoming() splittete mit text.split(':', 2) → choice=':1'
→ ':1'.isdigit()=False → Clarify nie resolved → Gateway Timeout.
Fix: Zweistufiger Split — erst '::' prüfen (neues Format),
dann ':' als Fallback (Other-Button). Beide Formate werden erkannt:
- CLARIFY:id::1 (numerischer Button)
- CLARIFY:id:other (Other-Button)
Architektur: Rainer | Implementierung: Miguel | QG: Rainer F1-F5 bestanden
This commit is contained in:
+9
-1
@@ -638,8 +638,16 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
# Handle CLARIFY button responses: CLARIFY:<clarify_id>:<choice> or CLARIFY:<clarify_id>:other
|
||||
if is_clarify_response and text.startswith("CLARIFY:"):
|
||||
try:
|
||||
if "::" in text:
|
||||
# Neues Format: CLARIFY:<id>::<choice> (via _build_custom_buttons)
|
||||
prefix_part, choice = text.split("::", 1)
|
||||
clarify_id = prefix_part.split(":", 1)[1]
|
||||
else:
|
||||
# Altes Format: CLARIFY:<id>:other (Other-Button)
|
||||
parts = text.split(":", 2)
|
||||
if len(parts) == 3:
|
||||
if len(parts) != 3:
|
||||
logger.debug("[rocketchat] Unrecognized CLARIFY format: %s", text)
|
||||
return
|
||||
_, clarify_id, choice = parts
|
||||
if choice == "other":
|
||||
# For "Other" button, enable text capture mode
|
||||
|
||||
Reference in New Issue
Block a user