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

fix(notifications): configure call hangs on Flutter app hot restart #3013

Merged
merged 2 commits into from
May 8, 2023

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented May 5, 2023

  • add requestInitialToken native API to be called within configure and not relying on App life cycle, where when the configure is called again after Flutter app restarted, the plugin can receive token normally

Issue #, if available:

#2989

Description of changes:

Added requestInitialToken native API to be called within configure and not relying on App life cycle, where when the configure is called again after Flutter app hot restarted, the plugin can still receive token normally.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@HuiSF HuiSF requested a review from a team as a code owner May 5, 2023 21:27
- add requestInitialToken native API to be called within configure and not relying on App life cycle, where when the configure is called again after Flutter app restarted, the plugin can receive token normally
@HuiSF HuiSF force-pushed the hui/fix/notifications/token-hangs-configure branch from 5add634 to 0d55802 Compare May 5, 2023 21:28
deviceToken = await _bufferedTokenStream.peek;
await _hostApi.requestInitialToken();
deviceToken =
await _bufferedTokenStream.peek.timeout(const Duration(seconds: 2));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 2 seconds long enough? Can we make it 5 or 10 to be safe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On iOS and Android token generation is client behavior, and doesn't require network round trip... it should be quick. But can increase the timeout surely to avoid surprises, as this timeout is for catching potential error without increasing latency for normal use cases. Will update to 5.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks!

@HuiSF HuiSF merged commit 8dac353 into main May 8, 2023
@HuiSF HuiSF deleted the hui/fix/notifications/token-hangs-configure branch May 8, 2023 20:42
dnys1 pushed a commit that referenced this pull request May 9, 2023
## 1.1.0

### Features
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

### Fixes
- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 9, 2023
## 1.1.0

### Features
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

### Fixes
- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 9, 2023
## 1.1.0

### Features
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

### Fixes
- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 11, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
Stivenmore pushed a commit to JunoLuK/amplify-flutter that referenced this pull request Jun 9, 2023
…ws-amplify#3013)

* fix(notifications): configure call hangs on Flutter app hot restart

- add requestInitialToken native API to be called within configure and not relying on App life cycle, where when the configure is called again after Flutter app restarted, the plugin can receive token normally

* Increase the timeout to 5 seconds.
Stivenmore pushed a commit to JunoLuK/amplify-flutter that referenced this pull request Jun 9, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([aws-amplify#2611](aws-amplify#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([aws-amplify#3013](aws-amplify#3013))
- fix(repo): AGP 8.0 compatibility ([aws-amplify#2942](aws-amplify#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants