Commit graph

9 commits

Author SHA1 Message Date
Miguel Alatzar
4dff2cc80c
[MM-25781] Don't retry nor use response message on 401 (#4433)
* Don't retry nor use response message on 401

* Explicitly call contentHandler on retry exhaustion

* Handle all non 200 responses for id_loaded notifications

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-06-25 12:04:10 -07:00
Elias Nahum
b85766ec31
MM-25931 Handle incoming session expired push notification (#4417) 2020-06-17 21:30:19 -04:00
Amit Uttam
3c03b0c13b
MM-25955 Refactor backoff/retry logic for failed id-loaded notifications (#4409)
Triggered per [this conversation](https://github.com/mattermost/mattermost-mobile/pull/4302#discussion_r426426887)

Raised question https://stackoverflow.com/questions/62293185/recursive-function-with-delay-in-between-calls?noredirect=1#comment110172449_62293185 which resolved the recursion.
2020-06-12 13:03:49 -03:00
Amit Uttam
b88b92ff4f
MM-25929 Decouple id-loaded retries from regular notification run (#4401)
Bug found in #4302 that delayed delivery/receipt of normal (non id-loaded) iOS push notifications. Response handling was happening within the guard block for id-loaded messages.
2020-06-09 15:52:17 -03:00
Amit Uttam
ea0f8ab5f0
MM-22181 Backoff retries for ID-loaded push notification messages (#4302)
* MM-22181 Backoff retries for ID-loaded push notification messages

Fibonacci backoffs. 6 attempts in ~20 seconds, not including response latency for each failure.

0 seconds to attempt 1 (original try)
1 seconds to attempt 2
2 seconds to attempt 3
3 seconds to attempt 4
5 seconds to attempt 5
8 seconds to attempt 6

* PR review: Reset re-request counter when server call succeeds

* PR Review: Localize scope of recursion counter

This handles scenario where multiple notification requests are being made at the same time for multiple messages. Counter will be isolated for each fetch request.

* PR Review: Remove unnecessary class variable

* Trigger Build

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-05-19 10:48:55 -07:00
Amit Uttam
558965aba3
Override bestAttemptContent only when we have values (#4012) 2020-03-05 13:39:32 -03:00
Elias Nahum
3ac0db6f61
MM-20347 Handle Flag for ID Loaded Push Notifications (#3586)
* Fix id-loaded on Android

* Fix id-loaded on iOS

* Remove constant for PUSH_TYPE_ID_LOADED
2019-11-21 19:34:10 -03:00
Miguel Alatzar
ba76e5eac7 [MM-16232] ID loaded push notifications (#3562)
* [MM-16232] Android: Fetch notification in notificationReceiptDelivery (#3552)

* Fetch notification in notificationReceiptDelivery

* Fix patch

* Fix patch take 2

* No need to send user_id to ack endpoint

* Just putString in mNotificationProps

* Fix patch take 3

* Revert react-native-notifications patch

* Update patch and fix rejections

* Remove trailing newline in patch

* Move PushNotification changes to end of patch

* npm cache test

* Revert "npm cache test"

This reverts commit d31030aaeeb010c1c3d22a5f6196191eeb849add.

* Created patch after upgrading node

* Created patch after upgrading node take 2

* Remove androidx changes from patch

* Patch packages then jetify

* Cache node_modules without patches

* Remove adding of default message (#3557)

* [MM-16232] iOS: Fetch id-loaded push notification from server (#3556)

* Fetch notification from server

* Parse fetched notification response

* Fix id-loaded notifications for DM/GM's

* audit fix

* Only add keys if they exist

* Throw exception if response code is not 200
2019-11-18 19:29:49 -03:00
Elias Nahum
5bf96272ae
Notification receipt delivery for Android and iOS (#2755)
* Notification receipt delivery for Android and iOS

* Update Fastlane with iOS notification service extension

* User JSONObject to build response
2019-05-15 12:45:26 -04:00