expo: Duplicate Push Notifications

Summary

Some users are reporting getting 20+ notifications of the same thing when ive only sent one request. Seems to have happened today for the first time with no code changes for 3 months and 150 DAU.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

No response

Environment

expo-env-info 1.0.3 environment info: System: OS: macOS 12.3 Shell: 3.0.0 - /usr/local/bin/fish Binaries: Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm Watchman: 2022.03.21.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /Users/renato/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: 13.3/13E113 - /usr/bin/xcodebuild npmPackages: babel-preset-expo: 9.0.2 => 9.0.2 expo: ^44.0.6 => 44.0.6 react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-native: ^0.67.4 => 0.67.4 Expo Workflow: bare

Reproducible demo

seems to not be related to local code.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 13
  • Comments: 40 (1 by maintainers)

Most upvoted comments

Hi all, I’m looking into this issue. Right now we’re not 100% certain of the cause, but I’ll do some investigation and we’ll attempt to prevent this from happening if we can. I’ll try to have another update next week, appreciate your patience.

I would like to second @amagnolo’s observation that this is likely related to migrating an app from Classic to EAS build. I suspect it is not as simple as merely having a duplicate Expo push token as a result of the migration - some devices consistently receive three copies of a single notification. That the number of duplicates is reliable suggests it is not, as a prior comment suggested, a result of retries due to Expo server 504 errors.

Given the current behavior, the documentation is misleading. However, the documentation has been accurate for years until I began to migrate to EAS builds. There appears to be a regression in Expo’s management of tokens, and if they cannot fix it retroactively for existing installs, it leaves the Expo push service unsafe to use because there is no way to predict how many duplicates of a given notification a user will receive.

I confirm that the problem is that the push token changes when the native app, built with EAS, is updated by the end user. The old token, stored in the backend database, remains valid: so when you send a notification to the old and to the new token, the user receives two notifications. I think that the problem lies in the expo notification server, where there are multiple tokens tied to the same application installation. There must be only one token valid for each application installation.

Same issue here, different expo notification tokens are created for a same Android device, resulting in multiple duplicate notifications. Not sure if this is caused by updating expo SDK

Also experiencing this with EAS build and Expo v49. It does seem to happen after our test users get a new TestFlight version, so that could be a data point.

I’m facing the same experience here, all of the notifications are double.

I went through the different expo SDK versions, expo 42 and expo 45. turn out it has a different expo notification token. maybe that is a cause.

btw, the only difference from my project was that expo42 uses classic build and expo45 uses eas build.