Ionic Cloud Deploy Service always downgrades Production to old Dev Version


#1

Hi,

I am using Ionic Cloud to build my packages in PROD mode. I noticed that for every cloud package I build with this command: ionic package build android --prod --release --profile prod

It ALSO puts a Deploy Snapshot into Ionic Deploy.

This means, that as soon as user downloads the app from the AppStore, it prompts them that there is a new version and downloads a DEV version of the build and downgrades them. The Dev version is NOT AOT/minified and uses the Dev variables (e.g. localhost) so it renders the app unusable.

My deployment service code is set to only look in the production channel (and a toast message confirms that this is the channel it is watching) - however it finds Dev channel snapshots and deploys them.

For now I have had to remove this functinoality from my app and do APK upgrades. Browsing the forum, it seems like quite a common problem.

Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.2.5
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed

and the code:

channel:", this.deploy.channel);
}

public isNewVersionAvailable(): Promise<boolean> {
    this.loggerService.info("DeployService - isNewVersionAvailable");
    if (this.platform.is('cordova')) {
        this.toastService.show("Canal: " + this.deploy.channel);
        return this.deploy.check();
    }
    else {
        this.toastService.show("DeployService: Running on web - cannot check for new versions...");
        return Promise.resolve(false);
    }
}

public checkForNewVersionUpdateAndAsk(): void {
    this.loggerService.info("checkForNewVersionUpdateAndAsk");
    if (this.platform.is('cordova')) {
        this.deploy.check()
            .then((snapshotAvailable: boolean) => {
                if (snapshotAvailable) {
                    this.showUpdateAlert();
                }
            })
            .catch(() => {
                //TODO: What to do here? Should we alert a service?
                this.loggerService.error("Error: Could not check for new versions - please try again or contact Support");
                this.toastService.showAndClose("Error: No fue posible buscar nuevas versiones - Por favor inténtalo más tarde o contacta a soporte");
            });
    }
    else {
        this.toastService.show("DeployService: Running on web - cannot check for new versions...");
    }
}

public downloadAndInstall(): any {
    if (this.platform.is('cordova')) {
        this.loggerService.error("downloadAndInstall");
        this.toastService.show("Descargando...");
        this.deploy.download()
            .then(() => {
                this.toastService.show("Extrayendo...");
                this.deploy.extract()
                    .then(() => {
                        this.toastService.show("Reiniciando...");
                        this.deploy.load();
                    })
            })
            .catch(() => {
                this.loggerService.error("Error: No es posible iniciar la descarga - please try again or contact Support");
                this.toastService.showAndClose("Error: No es posible iniciar la descarga - Por favor inténtalo más tarde o contacta a soporte");
            });
    }
    else {
        this.toastService.show("DeployService: Running on web - cannot download...");
    }
}

How to use Ionic Cloud Deploy on Ionic 2
Deploys outdated App version
#2

Clarifying:

  1. You are using Ionic (Cloud) Build.
  2. This uploads the html file to Ionic (Cloud) Deploy as “Ionic Package Upload: upload”.
  3. This upload is then “deployed” (activated) and offered in your app by the Ionic Cloud Deploy code although it is the wrong deploy channel.

Correct?


#3

Not exactly - I have narrowed down the problem a bit more and come up with a way to solve it.

Firstly- there seems to be 2 different problems. If I have a DEV channel snapshot marked as Active, this will overwrite a PRODUCTION channel build - it is NOT respecting the Active Channel in the deploy code.

The second problem is when the new snapshot is immediately overridden. I found the Dev snapshot build that was marked as active and set the version to 99.99.99 - now it does not overwrite it.

I am now careful not to do any DEV snapshots and can handle it manually , but it seems a bit buggy.


#4

Some people are using Ionic Deploy… I think someone would have reported it if a DEV channel upload/snapshot being activated would cause the PRODUCTION channel to cause this DEV version being downloaded (That’s what you are saying, right?).

Are you sure your app is set up correctly?


#5

Yes, definitely.

I have different versions in environment files (like 1.0.0p and 1.0.0d) as well as all my GA and Auth0 keys are different. After a prod upgrade I do a Toast message on the active Deploy channel and it is “production” (the same as the tag in Ionic, and also supposed to be the fall back IF the specified channel is not found).

The snapshot that overwrites it is the one marked as Active in the DEV channel.


#6

A post was split to a new topic: What version do deploy via Ionic Deploy?