Skip to content

Commit

Permalink
Just noop if trying to sync an Android channel that doesn't have an F…
Browse files Browse the repository at this point in the history
…M ID
  • Loading branch information
rowanseymour committed Sep 11, 2023
1 parent 323a8b0 commit 5722f4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/msgio/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion core/msgio/android_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5722f4d

Please sign in to comment.