-
Notifications
You must be signed in to change notification settings - Fork 249
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
Conversation
- 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
5add634
to
0d55802
Compare
deviceToken = await _bufferedTokenStream.peek; | ||
await _hostApi.requestInitialToken(); | ||
deviceToken = | ||
await _bufferedTokenStream.peek.timeout(const Duration(seconds: 2)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks!
## 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
## 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
## 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
…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.
- 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
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.