Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #827 +/- ##
==========================================
- Coverage 74.65% 68.64% -6.01%
==========================================
Files 32 32
Lines 1365 1381 +16
Branches 226 206 -20
==========================================
- Hits 1019 948 -71
- Misses 300 388 +88
+ Partials 46 45 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e4e97fc to
c91fc1c
Compare
|
Rebased onto master to pick up #826, addressed the review comments regarding |
| # transform legacy data to new message object | ||
| message = dict_to_fcm_message(data, **kwargs) | ||
|
|
||
| kwargs.setdefault("using", self._state.db or router.db_for_write(type(self), instance=self)) |
There was a problem hiding this comment.
With a replica router this still writes to the replica. db_for_write() already falls back to _state.db when no router picks one.
| kwargs.setdefault("using", self._state.db or router.db_for_write(type(self), instance=self)) | |
| kwargs.setdefault("using", router.db_for_write(type(self), instance=self)) |
| except ImportError: | ||
| from .apns import apns_send_message | ||
|
|
||
| kwargs.setdefault("using", self._state.db or router.db_for_write(type(self), instance=self)) |
There was a problem hiding this comment.
| kwargs.setdefault("using", self._state.db or router.db_for_write(type(self), instance=self)) | |
| kwargs.setdefault("using", router.db_for_write(type(self), instance=self)) |
| manager = models.APNSDevice.objects | ||
| if using: | ||
| manager = manager.using(using) | ||
| manager.filter(registration_id=registration_id).update(active=False) |
There was a problem hiding this comment.
.using(None) does the same as no .using(), so the if isn't needed.
| manager = models.APNSDevice.objects | |
| if using: | |
| manager = manager.using(using) | |
| manager.filter(registration_id=registration_id).update(active=False) | |
| models.APNSDevice.objects.using(using).filter( | |
| registration_id=registration_id | |
| ).update(active=False) |
| manager = models.APNSDevice.objects | ||
| if using: | ||
| manager = manager.using(using) | ||
| manager.filter(registration_id__in=inactive_tokens).update(active=False) |
There was a problem hiding this comment.
| manager = models.APNSDevice.objects | |
| if using: | |
| manager = manager.using(using) | |
| manager.filter(registration_id__in=inactive_tokens).update(active=False) | |
| models.APNSDevice.objects.using(using).filter( | |
| registration_id__in=inactive_tokens | |
| ).update(active=False) |
| manager = models.APNSDevice.objects | ||
| if using: | ||
| manager = manager.using(using) | ||
| manager.filter( |
There was a problem hiding this comment.
| manager = models.APNSDevice.objects | |
| if using: | |
| manager = manager.using(using) | |
| manager.filter( | |
| models.APNSDevice.objects.using(using).filter( |
| manager = GCMDevice.objects | ||
| if using: | ||
| manager = manager.using(using) | ||
| manager.filter(registration_id__in=deactivated_ids).update(active=False) |
There was a problem hiding this comment.
| manager = GCMDevice.objects | |
| if using: | |
| manager = manager.using(using) | |
| manager.filter(registration_id__in=deactivated_ids).update(active=False) | |
| GCMDevice.objects.using(using).filter( | |
| registration_id__in=deactivated_ids | |
| ).update(active=False) |
Preserve the originating database alias when deactivating invalid FCM and APNS devices during send operations instead of defaulting to the default database.
Fixes #825