Skip to content
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

Merged
merged 6 commits into from
Dec 6, 2021

Conversation

squahtx
Copy link
Contributor

@squahtx squahtx commented Nov 5, 2021

Addresses #255 together with #268 #281 and #269.

@squahtx squahtx force-pushed the squah/fix_gcmpushkin_appid_globs branch from 2a1f148 to b1b6c6d Compare November 5, 2021 13:01
# `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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

reivilibre
reivilibre previously approved these changes Nov 8, 2021
Copy link
Contributor

@reivilibre reivilibre left a 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

@squahtx
Copy link
Contributor Author

squahtx commented Nov 10, 2021

Mypy's sad here too, otherwise looks good

It'll be because it needs #268 to be merged first.

@squahtx
Copy link
Contributor Author

squahtx commented Dec 3, 2021

Nothing's really changed since the last review. It's only a merge from main followed by a switch to matrix-python-common.

@squahtx squahtx merged commit 86474e7 into main Dec 6, 2021
@squahtx squahtx deleted the squah/fix_gcmpushkin_appid_globs branch December 6, 2021 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants