chr233 / ASFEnhance

ASF 扩展命令插件 / External commands for ASF
GNU Affero General Public License v3.0
503 stars 41 forks source link

Inaccurate update logic (latest ASFE version updating itself) #324

Open Botan626 opened 3 days ago

Botan626 commented 3 days ago

During updating ASF from v6.0.7.5 to v6.0.8.0 ASFEnhance was updated from v2.2.3.3 to v2.2.3.3.

2024-10-01 00:43:31|ArchiSteamFarm-1|INFO|ASF|UpdateASF() Local version: 6.0.7.5 | Remote version: 6.0.8.0
2024-10-01 00:43:31|ArchiSteamFarm-1|INFO|ASF|UpdateASF() Fetching checksum from the remote server...
2024-10-01 00:43:32|ArchiSteamFarm-1|INFO|ASF|UpdateASF() This is automated GitHub deployment, human-readable changelog should be available soon. In the meantime please refer to GitHub commits.

2024-10-01 00:43:32|ArchiSteamFarm-1|INFO|ASF|UpdateASF() Downloading new version: 6.0.8.0 (18 MB)... While waiting, consider donating if you appreciate the work being done! :)
2024-10-01 00:43:33|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 0%...
2024-10-01 00:43:35|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 10%...
2024-10-01 00:43:36|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 20%...
2024-10-01 00:43:37|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 30%...
2024-10-01 00:43:38|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 40%...
2024-10-01 00:43:38|ArchiSteamFarm-1|INFO|03|FarmHours() Still farming: 262280
2024-10-01 00:43:39|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 50%...
2024-10-01 00:43:40|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 60%...
2024-10-01 00:43:40|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 70%...
2024-10-01 00:43:41|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 80%...
2024-10-01 00:43:42|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 90%...
2024-10-01 00:43:43|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASF-win-x64.zip 100%...
2024-10-01 00:43:43|ArchiSteamFarm-1|INFO|ASF|UpdateASF() Verifying checksum of the downloaded binary against the one from the remote server...
2024-10-01 00:43:43|ArchiSteamFarm-1|INFO|Microsoft.Hosting.Lifetime|Application is shutting down...
2024-10-01 00:44:14|ArchiSteamFarm-1|INFO|ASF|UpdateASF() Patching ASF files...
2024-10-01 00:44:14|ArchiSteamFarm-1|INFO|ASF|UpdatePlugins() Checking for plugin updates...
2024-10-01 00:44:14|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Checking update for ASFAchievementManager plugin...
2024-10-01 00:44:14|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Checking update for ASFEnhance plugin...
2024-10-01 00:44:14|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Checking update for CommandAliasPlugin plugin...
2024-10-01 00:44:14|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Checking update for CommandlessRedeem plugin...
2024-10-01 00:44:15|ArchiSteamFarm-1|INFO|ASF|GetTargetReleaseURL() No update available for ASFAchievementManager plugin: 1.0.0.1 ≥ 1.0.0.1.
2024-10-01 00:44:15|ArchiSteamFarm-1|INFO|ASF|GetTargetReleaseURL() Found ASFEnhance plugin update from version 2.2.3.3 to 2.2.3.3...
2024-10-01 00:44:15|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Updating ASFEnhance plugin...
2024-10-01 00:44:15|ArchiSteamFarm-1|INFO|ASF|GetTargetReleaseURL() No update available for CommandAliasPlugin plugin: 1.0.0.2 ≥ 1.0.0.2.
2024-10-01 00:44:15|ArchiSteamFarm-1|INFO|ASF|GetTargetReleaseURL() No update available for CommandlessRedeem plugin: 1.0.0.0 ≥ 1.0.0.0.
2024-10-01 00:44:16|ArchiSteamFarm-1|DEBUG|ASF|OnProgressChanged() ASFEnhance 0%...
2024-10-01 00:44:17|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Patching ASF files...
2024-10-01 00:44:17|ArchiSteamFarm-1|INFO|ASF|UpdatePlugin() Updating ASFEnhance plugin has succeeded, the changes will be loaded on the next ASF launch.
2024-10-01 00:44:21|ArchiSteamFarm-1|INFO|ASF|UpdateASF() Update process finished!
Botan626 commented 3 days ago

maybe updating logic from @Rudokhvist will help you to solve this

https://github.com/CatPoweredPlugins/CommandAliasPlugin/blob/main/CommandAliasPlugin/CommandAliasPlugin.cs

JustArchi commented 3 days ago

Not an issue with ASFE - ASF for compatibility reasons will update the plugin to the same version if more than one zip asset is found, since new ASF version could decide to use different asset than the one used in the previous run.

I have no clue why ASFE provides a zip asset per language though :slightly_smiling_face:

Botan626 commented 3 days ago

I have no clue why ASFE provides a zip asset per language though 🙂

So having only single ASFEnhance.zip archive in ASFE releases would fix it?

JustArchi commented 3 days ago

Yes, although what you're describing is not an issue, plugin can force itself to be updated to the same version at any time it wants, and it should never cause you issues.

Botan626 commented 3 days ago

plugin can force itself to be updated to the same version at any time it wants

I'm pretty sure @chr233 never intended this.

Botan626 commented 3 days ago

since new ASF version could decide to use different asset

And if the asset ASF decided to update to is the same as current one?

In this case ASFE is in the ASFEnhance-en-US directory (asset name?), version is the same (2.2.3.3), why updating?

chr233 commented 3 days ago

Not an issue with ASFE - ASF for compatibility reasons will update the plugin to the same version if more than one zip asset is found, since new ASF version could decide to use different asset than the one used in the previous run.

I have no clue why ASFE provides a zip asset per language though 🙂

tried use resx for multiple language support, and it will output resource dlls like zh-hans/ASFEnhance.resources.dll, and the plugin will always use the default language, even if define a linguage in String.Format method (tested in ASF 5.x.x.x), so I decide to use this way, not elegant enough, but it works

JustArchi commented 3 days ago

All ASF plugins are shipped with multi-lang support and they work fine, so it seems ASFE does something different which is why it doesn't load. You definitely should not have a real need for that.

chr233 commented 2 days ago

All ASF plugins are shipped with multi-lang support and they work fine, so it seems ASFE does something different which is why it doesn't load. You definitely should not have a real need for that.

You are right, this's a "historical issues"