#big issue with updater, placeholder not replaced in url

68 messages ยท Page 1 of 1 (latest)

fallen scaffold
#

Hi, I have a very big problem, we pushed a new version of the app but the app builded ~45days ago is unable to replace placeholder in the url

#

in cloud run logs

#
{
  "plugins": {
    "updater": {
      "endpoints": [
        "https://updater-j5zf5zm3ua-oa.a.run.app?target={{target}}-{{arch}}&current_version={{current_version}}"
      ]
    }
  }
}
``` I'm merging dev config with the -c cli opt
#

cloud run is full of log like that since the 5oct (the date I pushed a new version of my app)

rapid sun
#

did you change keys meanwhile?

brave lake
#

this was fixed a while ago

#

but yeah, if your old version used a broken alpha package then you're basically out of luck, unless you can somehow make your server listen to that broken url (probably only works if you serve a single platform)

fallen scaffold
#

So it was a false alarm

#

Or I would say already discovered and patched by awesome people ๐Ÿ˜Ž

fallen scaffold
#

@brave lake I'm afraid to tell you that it look like reappear in alpha 18 :/

#

(I bumped from 10 to 18 in this project)

brave lake
#

it's unrelated to the tauri version

#

just the updater plugin

fallen scaffold
#

hmm, I did a cargo update but not clean the target folder

#

could it be that ?

brave lake
#

depends on how you specified the version in cargo.toml

fallen scaffold
#

tauri-plugin-updater = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }

brave lake
#

that should be covered by cargo update then

#

to be clear, this has to be updated in the "old" version of your app, so you can't fix that version you released 45 days ago

fallen scaffold
#

yes, but I'm still able to reproduce I mean

#
name = "tauri-plugin-updater"
version = "2.0.0-alpha.4"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#445c1e6cb6971ef644a08d1224fc689923be301b"
dependencies = [
 "base64",
 "dirs-next",
 "flate2",
 "futures-util",
 "http",
 "minisign-verify",
 "percent-encoding",
 "reqwest",
 "semver",
 "serde",
 "serde_json",
 "tar",
 "tauri",
 "tempfile",
 "thiserror",
 "time",
 "tokio",
 "url",
 "zip",
]```

-> error while checking update, "unexpected character '{' while parsing major version number"
#

at least in dev, just now

#

by dev I mean with either tauri dev or tauri build --debug

brave lake
#

ehhhh

#

that sounds like a different issue actually

#

first guess would be that it fails to parse the response

fallen scaffold
#

yes because my api return the current version if no new version was found

#

but the api itself receive a https://updater-j5zf5zm3ua-oa.a.run.app/?target={{target}}-{{arch}}&current_version={{current_version}} , and then the api return a wrong json instead of a 4XX

fallen scaffold
#

because in fact only my stagging builds look affected, the production logs doesn't seen to have any of those (but cloud run have like lots of entries, absence of evidence is not evidence of absence)

brave lake
fallen scaffold
#

I'll check if I can't git clone + monkeypatch the src to check if it solve it

#

it's the best I can see in order to help

brave lake
#

or something of a reproduction would be cool too, i just tried it and it still works for me.

#

yeah, it works with my own api but not with yours

#

aaaaand i have a feeling why that may be, one sec

fallen scaffold
#

https ?

#
py -m http.server 80
Serving HTTP on :: port 80 (http://[::]:80/) ...
::ffff:127.0.0.1 - - [22/Nov/2023 15:29:16] "GET /?target={{target}}-{{arch}}&current_version={{current_version}} HTTP/1.1" 200 -
#

able to repro with a basic http server

brave lake
#

man fuck the url crate

#

we should've stayed with simple strings

#

(not the url crate's fault per se)

fallen scaffold
#

just tryed and it doesn't come from the json merged

#
# coding : utf-8
import shutil
import subprocess
from enum import Enum
from pathlib import Path

import typer


class Env(str, Enum):
    development = "development"
    production = "production"


def main(env: Env = typer.Option(..., "--env")) -> None:
    tauri_path = Path(__file__).resolve().parents[1] / "src-tauri"
    ppnm_path = shutil.which("pnpm")

    # tauri_dev_args = [ppnm_path, "tauri", "dev", "-c"]
    tauri_dev_args = [ppnm_path, "tauri", "dev"]
    # tauri_dev_args.append(str(tauri_path / f"{env.value}.conf.json"))

    print(f"running {' '.join(tauri_dev_args)}")
    subprocess.run(tauri_dev_args)


if __name__ == "__main__":
    typer.run(main)

brave lake
#

yeah so the issue is that it only works if you use the variables as path segments, not query arguments

#

So my pr i linked fixed the path segments, and broke query args

#

fun stuff

fallen scaffold
#

in fact it only affect my stagigng env and 2 customers which choiced to use the beta canal

#

x)

#

don't worry, I'm not really impacted

#

the good thing is we got it

brave lake
#

still something we have to fix asap (already did, just testing)

fallen scaffold
#

yeah, because i'm maybe not the only one which use qs

brave lake
#

exactly

fallen scaffold
#

my using any alpha framework ^

#

even if, tauri is more stable than electron, which is not in alpha

#

๐Ÿ‘€

brave lake
#

i mean, without brave devs like you we may would have released it with that bug

fallen scaffold
#

it's a codependancies x)

fallen scaffold
#

I confirm that using the reversion worked

#

I suppose it will not work when the branch will be squash merged ? but at least I can release for a quick fix

brave lake
#

just merged it so switch to the v2 branch before you run cargo update again

fallen scaffold
#

you rock ๐Ÿš€