-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GcmPushkin
to handle app ID globs correctly, introduced in 0.5.0
#270
Conversation
2a1f148
to
b1b6c6d
Compare
sygnal/gcmpushkin.py
Outdated
# `Notification` with a matching app ID. We do something a little dirty and | ||
# perform all of our dispatches the first time we get called for a | ||
# `Notification` and do nothing for the rest of the times we get called. | ||
app_id_pattern = glob_to_regex(self.name, ignore_case=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you pre-compile this at startup? re.compile
is was(?)* expensive.
*I believe it used to bypass the cache. Looking at the code in my Python 3.9 install, it seems like it uses the cache now.
However, pre-compiling is probably still best practice, especially since it's trivial to do in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it to be explicitly cached on startup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mypy's sad here too, otherwise looks good
It'll be because it needs #268 to be merged first. |
Nothing's really changed since the last review. It's only a merge from main followed by a switch to |
Addresses #255 together with
#268#281 and #269.