Amplify cli tries to create Notifications even though they already exist.
See original GitHub issueBefore opening, please confirm:
- I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- I have searched for duplicate or closed issues.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v14.17.0
Amplify CLI Version
10.3.2
What operating system are you using?
macOS Monterey 12.6
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
analytics, notifications
Amplify Commands
pull, push
Describe the bug
- Setup push notifications with the amplify cli (APNS and FCM) and push to the cloud.
- When pulling this on a different device (also using amplify cli) amplify wants to “create” the notifications category again. However this happened multiple months after the notifications were created, so multiple pull and push operations worked without causing any problems.
- When pulling or pushing amplify asks me to choose an authentication method for APNs. I don’t want to do this because everything should already be set up in the cloud.
Expected behavior
after adding and setting up notifications on one device and pushing to the cloud, amplify should not try to set notifications up on a different device.
Reproduction steps
-
create project and set up notifications with APNs and FCM on a device and push to cloud.
-
on another device set up amplify cli and pull everything.
-
cli will ask to choose authentication method (I then aborted the command)
-
my amplify-meta.json now contains the following
-
as you can see there is no “lastPushTimeStamp” so amplify probably believes that this resource is newly created. Also there is no other information except for the channels and service
-
run
amplify status
-
should now look something like this
-
run
amplify pull
-
cli will ask to choose authentication method (I then aborted the command)
-
now the amplify-meta.json contains the following
-
setting “HasTokenKey” to “true” leads to amplify not trying to create notifications category
-
now change something in your project to be able to run
amplify push
(for example you can simply add a space in your schema.graphql) -
when running
amplify pull
again the cli again asks me again to choose an authentication method for APNs -
so theoretically I can push without recreating notifications. However this is not the expected behaviour and I don’t want to do the above steps each time I have to push something.
-
I have also figured out that for some reason running
amplify env pull
instead of justamplify pull
leads to my amplify-meta.json looking again like this
GraphQL schema(s)
# Put schemas below this line
Project Identifier
Project Identifier: 8e7ec6dac606d8af0b67897bb966c442
Log output
# Put your logs below this line
Additional information
Seems to be related to (or exactly the same as) #6408 but I couldn’t comment or reopen this issue since it was closed. The solution there was to recreate the whole project. Since my project is already in production I would rather not do that.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (3 by maintainers)
Hi @ericstoecker @Mentioum we have a RC out with a fix for this issue which you can find here: https://www.npmjs.com/package/@aws-amplify/cli/v/10.4.0-rc.43121b9b9.0 and we are working to push it to latest
We’re also having this (or a similar) issue while using
v10.x.x
:It resulted in us having too many Pinpoint policies being added to our auth role.
This prevented us pushing after a while with the error:
can't have more than 10 policies per role
We manually deleted the invalid policies and duplicated pinpoint projects and downgraded to
v9.2.1
until this is fixed.Tagging @ralphkemp for reference.