Chaincase-iOS-Beta icon indicating copy to clipboard operation
Chaincase-iOS-Beta copied to clipboard

RegisterNotificationTokenAsync fires before Tor's up

Open DanGould opened this issue 4 years ago • 0 comments

General Description

Apple suggests the app register a push notification token each time the app launches. Once it gets a token, it sends it to the provider. We only accept tokens over Tor so sometimes the token POST times out before a connection to the backend is established over Tor. Then a user's first background CoinJoin experience fails because their device doesn't get the silent push to wake up.

Fix?

80%+ failures should go away by increasing retry attempts from 2 to 10 or 30 in RegisterNotificationTokenAsync @ 54 here. TorClient.SendAndRetryAsync delays 1s after each failed attempt.

https://github.com/chaincase-app/Chaincase/blob/242d021611772751f2c1c63f68caabf85cffcccb/Chaincase.Common/Services/ChaincaseClient.cs#L48-L57

DanGould avatar Dec 14 '21 06:12 DanGould