Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy over the server_auth into the
firebase
module
As part of #980 (and 5a8ca40 in particular), we initialize the firebase module with the values we read from the config. However, we removed the initialization of the `server_auth_token` https://github.com/e-mission/e-mission-server/pull/980/files#diff-5a90853314b14f3bec03976fa2ba81ec657e6327b770e9b376cfeabc0544487eL24 This is no longer used to send the actual notification, but it is used to map the FCM tokens to APNS. Note this is working for some deployments (e.g. nrel_commute) but not for other (e.g. stage). I can confirm that I get reminder notifications on my personal android phone. I don't understand how this ever worked - before #980, we weren't using the HTTP v1 version so no notifications were sent. After the change, this should have prevented notifications from being sent out. Testing done. Before the change ``` Connecting to database URL ... Traceback (most recent call last): File "/usr/src/app/bin/push/silent_ios_push.py", line 24, in <module> response = pnu.send_silent_notification_to_ios_with_interval(args.interval, dev=args.dev) File "/usr/src/app/emission/net/ext_service/push/notify_usage.py", line 41, in send_silent_notification_to_ios_with_interval return __get_default_interface__().send_silent_notification(token_map, {}, dev) File "/usr/src/app/emission/net/ext_service/push/notify_interface_impl/firebase.py", line 194, in send_silent_notification fcm_token_map = self.convert_to_fcm_if_necessary(token_map, dev) File "/usr/src/app/emission/net/ext_service/push/notify_interface_impl/firebase.py", line 137, in convert_to_fcm_if_necessary importedResultList = self.retrieve_fcm_tokens(unmapped_token_list, dev) File "/usr/src/app/emission/net/ext_service/push/notify_interface_impl/firebase.py", line 98, in retrieve_fcm_tokens importHeaders = {"Authorization": "key=%s" % self.server_auth_token, AttributeError: 'FirebasePush' object has no attribute 'server_auth_token' ``` After the change ``` Config file not found, returning a copy of the environment variables instead... Retrieved config: {'DB_HOST': '...', 'DB_RESULT_LIMIT': None} Connecting to database URL ... Received invalid result for batch starting at = 0 after mapping iOS tokens, imported 0 -> processed 0 combo token map has 30 ios entries and 0 android entries Successfully sent to ... Successfully sent to ... Successfully sent to ... Found error Token not registered while sending to token ... skipping Successfully sent to ... Successfully sent to ... Found error Token not registered while sending to token ... skipping Successfully sent to ... Successfully sent to -3sW... Found error Token not registered while sending to token ... skipping Successfully sent to ... ```
- Loading branch information