# setMyPushTriggerOption is not immediately updated at some group channel

**URL:** <https://community.sendbird.com/t/setmypushtriggeroption-is-not-immediately-updated-at-some-group-channel/3579>\
**Category:** JavaScript\
**Tags:** group-channel, push-notification\
**Created:** [December 15, 2021, 3:53am UTC](https://community.sendbird.com/t/setmypushtriggeroption-is-not-immediately-updated-at-some-group-channel/3579 "2021-12-15T03:53:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user3](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/user3/32/1859_2.png) [@user3](https://community.sendbird.com/u/user3)\
**Post date:** [December 15, 2021, 3:53am UTC](https://community.sendbird.com/t/setmypushtriggeroption-is-not-immediately-updated-at-some-group-channel/3579/1 "2021-12-15T03:53:38Z")

</div>

I try to call setMyPushTriggerOption for ON/OFF user’s push options.

- After calling setMyPushTriggerOption, it looks push\_trigger\_options updated well. The issue is channel’s `myPushTriggerOption` is not updated immediately
- It updated immediately at `isPublic:true` group channel,
- But not updated immediately if that group channel is `isPublic:false`.
- The only figured difference is `isPublic` value.

Is there any differences or needed options to update `myPushTriggerOption` immediately? Or there’s something I could not checked?

---

<div class="post-metadata">

**Author:** ![Charis\_Theodoulou](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/charis_theodoulou/32/1401_2.png) [@Charis\_Theodoulou](https://community.sendbird.com/u/Charis_Theodoulou)\
**Post date:** [December 16, 2021, 4:16pm UTC](https://community.sendbird.com/t/setmypushtriggeroption-is-not-immediately-updated-at-some-group-channel/3579/2 "2021-12-16T16:16:11Z")

</div>

Hi,

Thank you for posting your question in the community.

Can you please elaborate more on ‘_channel’s `myPushTriggerOption` is not updated immediately_’?  
Are you receiving push for the user after you set the push trigger option to ‘off’ or not getting any push notifications after you set it to ‘all’ or default?

Can you also please share the code where you are updating the push trigger options? It might be helpful in trying to reproduce this on our end.

---

<div class="post-metadata">

**Author:** ![user3](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/user3/32/1859_2.png) [@user3](https://community.sendbird.com/u/user3)\
**Post date:** [December 17, 2021, 5:29am UTC](https://community.sendbird.com/t/setmypushtriggeroption-is-not-immediately-updated-at-some-group-channel/3579/3 "2021-12-17T05:29:05Z")

</div>

Thanks for your reply!  
Here are more elaborate descriptions.

1. The event handler code where user is updating the push trigger options

```auto
  const handleValueChangePush = async value => {
    const changedOption = value ? PUSH_TRIGGER_OPTIONS.DEFAULT : PUSH_TRIGGER_OPTIONS.OFF;
    setIsPushOn(value);
    setChannelInfo({ ...channelInfo, myPushTriggerOption: changedOption });
    await **channel.setMyPushTriggerOption(changedOption)**;
  };

```

1. And after set the options to “off”, user cannot received the notification (works well)

2. But after refetch the channel object using `createMyGroupChannelListQuery()` that channel’s `myPushTriggerOption` gives `"default"` value. Only if `isPublic:true` group channel.

Hope this answers are helpful for reporting.  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Charis\_Theodoulou](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/charis_theodoulou/32/1401_2.png) [@Charis\_Theodoulou](https://community.sendbird.com/u/Charis_Theodoulou)\
**Post date:** [December 17, 2021, 5:05pm UTC](https://community.sendbird.com/t/setmypushtriggeroption-is-not-immediately-updated-at-some-group-channel/3579/4 "2021-12-17T17:05:36Z")

</div>

Thank you for the provided information.

I tested this and I see what might be the issue here. You will have to fetch again the list of channels by running `createMyGroupChannelListQuery` **_after_** you have set the push preferences for a user.

For example:

```javascript
await handleValueChangePush(value)
await updateChannelList() // call createMyGroupChannelListQuery again inside here

```
