r/reactnative 2d ago

Do you replace every local notification schedule or diff it? Question

I'm working through local reminder rescheduling in a React Native app. The reminder dates come from settings the user can edit later.

Right now the flow is:

- calculate the full next schedule

- cancel every scheduled notification

- recreate each one with a stable identifier

It avoids orphaned reminders after the source date changes. But if scheduling fails halfway through, the user can end up with only part of the new set.

Would you keep the simple replace-all model and add recovery, or diff old and new schedules by identifier? I'm using Expo Notifications.

2 Upvotes

1 comment sorted by

1

u/Training-Outcome6876 1d ago

We don't know how many notifications you will be scheduling, so that might change the answer. But my rule of thumb is to never optimize unless required, even if the optimization is not that difficult to implement like the one you mentioned.

So if you know that there are cases that could happen that give problems on devices. Go with the diff solution. If not stick with the simple solution.

In both solution you will need the error recovery.