Skip to content

Commit

Permalink
Merge pull request #123 from nyaruka/android_tweak
Browse files Browse the repository at this point in the history
Just noop if trying to sync an Android channel that doesn't have an FCM ID
  • Loading branch information
rowanseymour authored Sep 11, 2023
2 parents 323a8b0 + 5722f4d commit eff559f
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 eff559f

Please sign in to comment.