Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

refactor: cleanup some deferred arg bookkeeping #859

Merged
merged 2 commits into from
Apr 6, 2017
Merged

Conversation

pjenvey
Copy link
Member

@pjenvey pjenvey commented Apr 4, 2017

prepping some cleanup before the actual #695 handler change

@codecov-io
Copy link

codecov-io commented Apr 4, 2017

Codecov Report

Merging #859 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #859   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          49     50    +1     
  Lines        9544   9568   +24     
=====================================
+ Hits         9544   9568   +24
Impacted Files Coverage Δ
autopush/router/webpush.py 100% <ø> (ø) ⬆️
autopush/router/fcm.py 100% <100%> (ø) ⬆️
autopush/utils.py 100% <100%> (ø) ⬆️
autopush/router/gcm.py 100% <100%> (ø) ⬆️
autopush/router/apnsrouter.py 100% <100%> (ø) ⬆️
autopush/tests/test_web_validation.py 100% <100%> (ø) ⬆️
autopush/websocket.py 100% <100%> (ø) ⬆️
autopush/web/registration.py 100% <100%> (ø) ⬆️
autopush/router/interface.py 100% <100%> (ø) ⬆️
autopush/tests/test_endpoint.py 100% <100%> (ø) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64b42fc...55e91c5. Read the comment docs.

autopush/db.py Outdated
@@ -70,6 +70,7 @@

# Typing
T = TypeVar('T') # noqa
ItemLike = Union[Item, Dict[str, Any]]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dict[str, Any] looks like a pretty common pattern. Didn't know if you wanted to do a similar alias trick for that.

if not uaid:
uaid = uuid.uuid4()
d = defer.execute(
router.register,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are inconsistent with how we're calling router.register (sometimes via named args, sometimes via ordered.) We had gone to named args prior because ordered had lead to some sleeper bugs. I would recommend we stay with that practice so that future coders don't hit the same problems.

pjenvey added 2 commits April 6, 2017 14:15
- params -> router_data, kill unused vapid_info/body
- kill bogus/unused timing vars
- app_id isn't optional

issue #695
- try to isolate it to the deferred definition and avoid passing args
back and forth when not necessary
- also put all_channels call back in a thread

issue #695
@jrconlin jrconlin merged commit 1f3c3b2 into master Apr 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants