1
0

Push service release version 4

This commit is contained in:
2020-12-25 01:10:32 +01:00
parent 4c58aa3ed0
commit 02fa209012
7 changed files with 43 additions and 29 deletions

View File

@@ -59,6 +59,13 @@ public class ExternalPushServiceResponseHandler {
updateSubscription(subscription);
break;
case 403: // Forbidden
// also "SENDER_ID_MISMATCH" - may happen if the VAPID keys were changed -> subscription needs to be removed
// AND CLIENT NEEDS TO RE-SUBSCRIBE (not sure how to control that from here, though)
LOGGER.error(String.format("Received 403 for endpoint %s", subscription.getEndpoint()));
deleteSubscription(subscription);
break;
case 404: // Not found
// Subscription expired or endpoint is wrong -> subscription needs to be removed
LOGGER.info(String.format("Received 404 for endpoint %s", subscription.getEndpoint()));
@@ -80,6 +87,8 @@ public class ExternalPushServiceResponseHandler {
updateSubscription(subscription);
break;
default:
LOGGER.error(String.format("Unhandled HTTP response code: %s for endpoint %s",
response.getStatusLine().getStatusCode(), subscription.getEndpoint()));
}
} catch (InterruptedException ire) {
LOGGER.error(String.format("Thread interrupted for endpoint %s", subscription.getEndpoint()));