Hi, I use amplify react native to build both ios and Android application. I created two environment branch on both git and amplify - dev and production. Recently I built my application and ran into a very strange problem.
- Login in user (cognito from production env)
- Query data ( api graphql from production env)
- Force close the app or logout and login again (this cognito username exist on both production and development env)
- Query data (api graphql from dev env)
As you can see from above, all the sudden my app switch to development environment even though the app build is intend for production. How is it possible to have mix env co-exist in my app? The way I handle env build is like this:
When working on dev environment:
- git commit to dev
- git push to dev
- amplify init or env checkout to dev
- amplify push (if any changes)
- build the dev image
When switch to production environment:
- git checkout master which is production env
- git merge dev to master which is production env
- git push to master which is production
- amplify env checkout to production env
- amplify push (if any changes)
- build the production image
The way I make sure my amplify environment setup switch to production is by checking inside the aws-exports.js file. And as I stated above, my first launch always points me correctly to the production server. Then how is it possible to switch from a production to a development server? Is there any place I missed causing such sudden switch?
I really hope to get feedback from the aws amplify development team. This issue is preventing my from launching my app to the store. It would be a disaster if I didn't run enough test before launch.
In addition, I suspect the config might be cache somewhere in the device during my development testing, but tried a brand new device and the problem persist. So that is not the case.
Thanks in advance for the support.
Edited by: rmwh6 on Aug 29, 2019 9:00 PM
Edited by: rmwh6 on Aug 29, 2019 9:01 PM
Edited by: rmwh6 on Aug 29, 2019 9:02 PM
Edited by: rmwh6 on Aug 29, 2019 9:05 PM
Edited by: rmwh6 on Aug 29, 2019 9:08 PM
Edited by: rmwh6 on Aug 29, 2019 9:09 PM
Edited by: rmwh6 on Aug 29, 2019 9:10 PM