Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Feature Request: skip extension updates if minimum version is not met #7009

Open
agc93 opened this issue Jul 24, 2020 · 8 comments
Open
Labels
improvement 📈 An issue that improves an existing feature

Comments

@agc93
Copy link
Contributor

agc93 commented Jul 24, 2020

Is your feature request related to a problem? Please describe.
If an extension wants to introduce non-backwards-compatible changes, the IExtensionContext includes requireVersion that will prevent an extension from loading in incompatible Vortex versions. The issue I'm trying to avoid is that a user who doesn't update their Vortex immediately will still have their extension updated to a version that no longer supports their current Vortex version and it will be unloaded.

Describe the solution you'd like
To be clear, I haven't been able to fully understand/discern the extension update process so what I'm asking for might be impossible. Based on #6597 it seems like there is at least a period of time where both the old extension and new extension are installed. Ideally, when the new version fails to load (since unloadIncompatible will unload extensions where the requireVersion isn't met), the upgrade could be "aborted" somehow, still leaving the old version in place.

Describe alternatives you've considered
The only other alternative I can think of is moving the Vortex version requirement into an optional field in info.json which means Vortex would be able to see incompatible versions before it installed/activated the new version, but that sounds like a lot of work.

Additional context
This has come about for two things in BeatVortex: I want to use the new tool parameter stuff (#6629 ), but since people might not have updated to 1.3 when I publish the update, I can't fully rely on it being there without completely breaking existing installs. Likewise, there's upcoming changes in upstream APIs that BeatVortex uses which will require breaking changes.

Ideally, I could publish a new version of the extension that requires a newer Vortex version and old users wouldn't have their games "surprise unmanaged" when the extension gets unloaded on next start, but once they updated to 1.3, the extension would update correctly.

@TanninOne
Copy link
Contributor

This is already possible in a way though this is barely tested (The "Fully Virtual deployment" extension makes use of it).
Vortex generates a separate extension file for each mayor version, so 1.3 will have a separate extensions list from 1.2 and our tool updating those lists will look for the string "requires vortex version pattern" in the file description where "version pattern" can be something along the lines of "requires vortex >= 1.3.0" or "Requires Vortex ~1.3.0" (the text is case insensitive but otherwise it has to match exactly)

You should be able to have multiple "main files" for your extension as long as their version compatibility is mutually exclusive so you can have one with "requires vortex < 1.3.0" and one with "requires vortex >= 1.3.0" to support both users from older and never versions. Technically you could also require a certain minor version (>=1.3.5) but since we only have one extension list for each mayor version, users with vortex 1.3.0-1.3.4 would then not get your extension offered at all.

I know it's kind of fiddly to parses a string from the file description but unfortunately for the time being it's impractical to download each mod to check for the requirement and on the up-side, this ensures users can see the version requirement on the mod page and you can update it without having to re-upload the mod.

Please drop me a line when you start making use of it and I will double check that your extension gets added to the lists appropriately.

@TanninOne TanninOne added the improvement 📈 An issue that improves an existing feature label Jul 27, 2020
@agc93
Copy link
Contributor Author

agc93 commented Jul 28, 2020

That's impressively hacky, but if it works, fine by me 😆

I've updated the description of the current version of BeatVortex to include a version constraint on 1.2.x and I'll let you know once I upload a 1.3.x-requiring file version.

@TanninOne
Copy link
Contributor

Well, I'd use the term "pragmatic" instead of "hacky"...
Got to work with what we have ;)

@agc93
Copy link
Contributor Author

agc93 commented Aug 4, 2020

Before I upload a 1.3 version, one question on this: how does it handle multiple matches? If I had one file with a requires match of ^ 1.2.0 and another with ~1.3.0, they would technically both match for a user on 1.3.0.

@TanninOne
Copy link
Contributor

Yeah, that wouldn't work, it requires a single match for each major version, otherwise the extension won't appear in the list at all.

@agc93
Copy link
Contributor Author

agc93 commented Aug 10, 2020

@TanninOne I've just uploaded a 0.4.0 of BeatVortex that requires Vortex 1.3+. I've added the text to the description and left the (1.2-requiring) older version in Main files.

Can you confirm I've done it right (0.3.9 offered to 1.2 users, 0.4.0 offered to 1.3 users)?

@agc93
Copy link
Contributor Author

agc93 commented Aug 11, 2020

@TanninOne Looks like it all got picked up alright from @IDCs recent updates: 0.3.9 (file 631) is in the ...1_2.json and 0.4.0 (file 673) is in the ...1_3.json file. 👍

@IDCs
Copy link
Contributor

IDCs commented Aug 11, 2020

Hey @agc93, yeah saw your updated extension this morning and made sure the json files get updated correctly. FYI Tannin is on holiday for two weeks so he may not be very responsive until he's back. Let me know if you need any help while he's away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement 📈 An issue that improves an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants