chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.44k stars 135 forks source link

Having `clink.autoupdate auto`, Clink doesn't seem to check for updates (in order to update to 1.6.18 from 1.6.17) #640

Closed darkred closed 1 month ago

darkred commented 1 month ago

Greetings

The issue is that having clink.autoupdate auto didn't get a notification to update to 1.6.18 from 1.6.17

In details:

I have Clink installed on windows 11 pro x64. It was installed via clink.1.6.16.c5eaf9_setup.exe . It's set to autorun when cmd.exe starts. Also clink set clink.autoupdate was set to "check" (the default value). On July 14 v1.6.17 was released, and Clink (at cmd.exe launch) showed a notification popup, about the new version. Instead of clicking the "Update now" button in the popup, I pressed Cancel and I changed the setting to "auto" from "check" (via clink set clink.autoupdate auto) and relaunched cmd.exe: clink checked for updates automatically and prompted to install the 1.6.17 update, as expected.

Yesterday Clink 1.6.18 was released, but I never saw Clink check for updates or attempting to install the update (I launched cmd.exe multiple times since yesterday to be sure). Why is this happening?

Here is a clink-diagnostics output: ```log version: version 1.6.17.1fe17f binaries C:\Program Files (x86)\clink session: session 28768 profile C:\Users\Kostas\AppData\Local\clink log C:\Users\Kostas\AppData\Local\clink\clink.log default_settings C:\Program Files (x86)\clink\default_settings settings C:\Users\Kostas\AppData\Local\clink\clink_settings history C:\Users\Kostas\AppData\Local\clink\clink_history scripts C:\Program Files (x86)\clink ; C:\Users\Kostas\AppData\Local\clink default_inputrc C:\Program Files (x86)\clink\default_inputrc language: codepage 1253 keyboard langid 1033 keyboard layout 00000409 prompt refilter: refilter 2 redisplay 2 (Use a numeric argument for additional diagnostics; e.g. press Alt+1 first.) ```
darkred commented 1 month ago

In clink.log I see this update-related line:

7060 @~clink~/app/update.lua   370 Clink updater: too soon to check for updates (1721933434 vs 1722364572).

These two unix timestampts refer to: the former 5 days ago, the latter 14 minutes ago.

~What does this mean? Shouldn't the updater check for updates now?~

I'm glad to see that when I relaunched cmd.exe the updater works fine (downloads the update and pops up a prompt window, as elevation is needed).

chrisant996 commented 1 month ago

Refer to the documentation on Automatic Updates.

The default interval is 5 days between checks.

darkred commented 1 month ago

Thanks a lot for the reply and sorry for the noise, I didn't read the documentation thoroughly enough before posting.

chrisant996 commented 1 month ago

This report made me notice that the documentation section doesn't specifically mention the default interval or how the internal affects how quickly Clink notices new updates.

I'm going to tweak the documentation text to clarify that.

Thanks!

chrisant996 commented 1 month ago

I've updated the Automatic Updates documentation to mention the default interval and what it means.

darkred commented 1 month ago

Thanks a lot for the documentation improvements!

Could you please clarify one thing: I want it to check for updates every day, ideally at every clink/cmd launch, like oh-my-posh. Is it valid to set the interval to 0 days? I am asking because I have clink set clink.autoupdate 0 and don't get the notification to update to 1.6.20 from 1.6.18. Or the minimum valid interval value is 1 day? If that's the case, could you please make 0 day a valid value?

chrisant996 commented 1 month ago

Could you please clarify one thing: I want it to check for updates every day, ideally at every clink/cmd launch, like oh-my-posh. Is it valid to set the interval to 0 days? I am asking because I have clink set clink.autoupdate 0 and don't get the notification to update to 1.6.20 from 1.6.18. Or the minimum valid interval value is 1 day? If that's the case, could you please make 0 day a valid value?

It intentionally doesn't allow 0 days.

I don't want to allow 0 days. Having a minimum of 1 day helps make updates roll out progressively instead of all at once.

For example, yesterday I published v1.6.19, but it had a bug that breaks the updater. Fortunately, the update interval limited how many people got the bad update before I was able to make a fix and publish a new update.

I'm sorry, but I'm not going to allow Clink to have a 0-day interval that checks on every startup.

darkred commented 1 month ago

No problem, I understand. Thank you very much again for the detailed answer.