File tree 3 files changed +10
-2
lines changed
src/main/java/com/google/firebase/messaging 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
-
2
+ * [ changed] Retry Topic Subscribe/Unsubscribe operations with exponential
3
+ backoff if they hit a quota error.
3
4
4
5
# 24.0.0
5
6
* [ changed] Switched Firelog to use the new TransportBackend.
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ class GmsRpc {
58
58
/** Another server error besides ERROR_SERVICE_NOT_AVAILABLE that we retry on. */
59
59
static final String ERROR_INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR" ;
60
60
61
+ /**
62
+ * A server error that represents hitting topic subscription quota. Trying again here may
63
+ * continue to fail, but as long as we use exponential backoff its okay to retry.
64
+ */
65
+ static final String TOO_MANY_SUBSCRIBERS = "TOO_MANY_SUBSCRIBERS" ;
66
+
61
67
/** Heartbeat tag for firebase iid. */
62
68
static final String FIREBASE_IID_HEARTBEAT_TAG = "fire-iid" ;
63
69
Original file line number Diff line number Diff line change @@ -251,7 +251,8 @@ boolean performTopicOperation(TopicOperation topicOperation) throws IOException
251
251
} catch (IOException e ) {
252
252
// Operation failed, retry failed only if errors from backend are server related error
253
253
if (GmsRpc .ERROR_SERVICE_NOT_AVAILABLE .equals (e .getMessage ())
254
- || GmsRpc .ERROR_INTERNAL_SERVER_ERROR .equals (e .getMessage ())) {
254
+ || GmsRpc .ERROR_INTERNAL_SERVER_ERROR .equals (e .getMessage ())
255
+ || GmsRpc .TOO_MANY_SUBSCRIBERS .equals (e .getMessage ())) {
255
256
Log .e (TAG , "Topic operation failed: " + e .getMessage () + ". Will retry Topic operation." );
256
257
257
258
return false ; // will retry
You can’t perform that action at this time.
0 commit comments