From 5722f4da368bf29c04ece4e54c59d71db2373aa1 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Mon, 11 Sep 2023 11:28:02 -0500 Subject: [PATCH] Just noop if trying to sync an Android channel that doesn't have an FM ID --- core/msgio/android.go | 2 +- core/msgio/android_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/msgio/android.go b/core/msgio/android.go index bc329b658..75cdde97a 100644 --- a/core/msgio/android.go +++ b/core/msgio/android.go @@ -21,7 +21,7 @@ func SyncAndroidChannel(fc *fcm.Client, channel *models.Channel) error { // no FCM ID for this channel, noop, we can't trigger a sync fcmID := channel.ConfigValue(models.ChannelConfigFCMID, "") if fcmID == "" { - return errors.New("channel has no FCM ID") + return nil } sync := &fcm.Message{ diff --git a/core/msgio/android_test.go b/core/msgio/android_test.go index 9ce7fba24..63eaf3e6a 100644 --- a/core/msgio/android_test.go +++ b/core/msgio/android_test.go @@ -84,7 +84,7 @@ func TestSyncAndroidChannel(t *testing.T) { err = msgio.SyncAndroidChannel(nil, channel1) assert.EqualError(t, err, "instance has no FCM configuration") err = msgio.SyncAndroidChannel(fc, channel1) - assert.EqualError(t, err, "channel has no FCM ID") + assert.NoError(t, err) err = msgio.SyncAndroidChannel(fc, channel2) assert.EqualError(t, err, "error syncing channel: 401 error: 401 Unauthorized") err = msgio.SyncAndroidChannel(fc, channel3)