Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expo-notifications][Android] adjust logic in handling responses when app in background or killed #29659

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

douglowder
Copy link
Contributor

@douglowder douglowder commented Jun 11, 2024

Why

The logic in onNotificationResponseFromExtras needs to be adjusted to correctly check whether response listeners are active, and do that check first before falling back to add the response to the pending responses (eventually used by useLastNotificationResponse() in JS).

See #28656 (comment)

How

Inverted the order of checks in the method.

Test Plan

  • CI should pass
  • Test the flows with the test app, using both expo-server-sdk tool and expo.dev/notifications web tool

Checklist

@douglowder douglowder requested a review from tsapeta as a code owner June 11, 2024 19:00
Copy link

linear bot commented Jun 11, 2024

@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against edbba75

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Jun 11, 2024
@expo-bot
Copy link
Collaborator

The Pull Request introduced fingerprint changes against the base commit: e7f82b4

Fingerprint diff
[
  {
    "type": "dir",
    "filePath": "../../packages/expo-notifications/android",
    "reasons": [
      "expoAutolinkingAndroid"
    ],
    "hash": "d7305631bd216ab148146142fda04f908c3c8f03"
  }
]

Generated by PR labeler 🤖

@douglowder douglowder merged commit 0dccb1d into main Jun 11, 2024
18 checks passed
@douglowder douglowder deleted the doug/eng-12471-expo-notificationsandroid-patch branch June 11, 2024 19:50
douglowder added a commit that referenced this pull request Jun 11, 2024
… app in background or killed (#29659)

# Why

The logic in `onNotificationResponseFromExtras` needs to be adjusted to
correctly check whether response listeners are active, and do that check
first before falling back to add the response to the pending responses
(eventually used by `useLastNotificationResponse()` in JS).

See #28656 (comment)

# How

Inverted the order of checks in the method.

# Test Plan

- CI should pass
- Test the flows with the test app, using both expo-server-sdk tool and
expo.dev/notifications web tool

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
marklawlor pushed a commit that referenced this pull request Jun 12, 2024
… app in background or killed (#29659)

# Why

The logic in `onNotificationResponseFromExtras` needs to be adjusted to
correctly check whether response listeners are active, and do that check
first before falling back to add the response to the pending responses
(eventually used by `useLastNotificationResponse()` in JS).

See #28656 (comment)

# How

Inverted the order of checks in the method.

# Test Plan

- CI should pass
- Test the flows with the test app, using both expo-server-sdk tool and
expo.dev/notifications web tool

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
@douglowder douglowder added the published Changes from the PR have been published to npm label Jun 12, 2024
douglowder added a commit that referenced this pull request Jun 12, 2024
… app in background or killed (#29659)

The logic in `onNotificationResponseFromExtras` needs to be adjusted to
correctly check whether response listeners are active, and do that check
first before falling back to add the response to the pending responses
(eventually used by `useLastNotificationResponse()` in JS).

See #28656 (comment)

Inverted the order of checks in the method.

- CI should pass
- Test the flows with the test app, using both expo-server-sdk tool and
expo.dev/notifications web tool

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: suggestions ExpoBot has some suggestions published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants