You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a function with a realtime DB trigger.
@db_fn.on_value_created(reference="/messages/{user}/{chat_id}/{msg_id}")
def do_work(event: db_fn.Event[Any]) -> None:
# process event
From reading the docs, I expect this to match on a message pushed to a chat with chat_id. For example, a value created at /messages/user_1/chat_1/msg_a would be captured and the appropriate ids sent to the function.
However, when I attempt to implement this functionality, errors crop up in the pattern matching code:
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/firebase_functions/private/path_pattern.py", line 177, in extract_matches
matches[segment.trimmed] = path_segments[path_ndx]
~~~~~~~~~~~~~^^^^^^^^^^
IndexError: list index out of range
It seems like the pattern-matching code errors out in this situation where the value created is at a ref with a wildcard in the last path segment. I'm using a workaround right now but thought I'd bring it up as an issue.
The text was updated successfully, but these errors were encountered:
I'm writing a function with a realtime DB trigger.
From reading the docs, I expect this to match on a message pushed to a chat with chat_id. For example, a value created at
/messages/user_1/chat_1/msg_a
would be captured and the appropriate ids sent to the function.However, when I attempt to implement this functionality, errors crop up in the pattern matching code:
It seems like the pattern-matching code errors out in this situation where the value created is at a ref with a wildcard in the last path segment. I'm using a workaround right now but thought I'd bring it up as an issue.
The text was updated successfully, but these errors were encountered: