lnbits-extensions icon indicating copy to clipboard operation
lnbits-extensions copied to clipboard

feat: max_lnbits_version for older releases

Open dni opened this issue 1 year ago • 7 comments

  • this can help the extension manager to know if the current installed lnbits is compatible with an release.
  • this will make it also possible to deprecate unmaintained extension which will break on newer releases

each min_lnbits_version change in the future will mean we have to manually change the max_lnbits_version of the incompatible release aswell, which is fine i think (we already have to change min_version).

this will also help for the 0.13.0 release were every current ext will break. i already added those max version to latest releases upfront in this pr.

new releases will have an max_lnbits_version of 0 or we just remove the key from the json

dni avatar Aug 07 '24 10:08 dni

max_lnbits_version kind of sounds like the ext still works with this version

trying to come up with a better name, but I can't think of any good one, though ...

prusnak avatar Aug 07 '24 10:08 prusnak

max_lnbits_version kind of sounds like the ext still works with this version

trying to come up with a better name, but I can't think of any good one, though ...

  • deprecated_from_lnbits_version?

motorina0 avatar Aug 08 '24 09:08 motorina0

whats so wrong about max version, i think its perfectly fine and describe it exactly

dni avatar Aug 08 '24 09:08 dni

whats so wrong about max version, i think its perfectly fine and describe it exactly

  • min_version_... is the lowest version of LNbits that the extension works on
  • max_version_... is the [@dni fill in the blank please]

motorina0 avatar Aug 08 '24 09:08 motorina0

whats so wrong about max version, i think its perfectly fine and describe it exactly

* `min_version_...` is the lowest version of LNbits that the extension works on

* `max_version_...` is the [@dni fill in the blank please]

its actually the first it does not work. actually the min version of the next release incompat_lnbits_version, not sure

i still would prefer max version every package manager has min and max version so it familiar.

dni avatar Aug 08 '24 09:08 dni

whats so wrong about max version, i think its perfectly fine and describe it exactly

* `min_version_...` is the lowest version of LNbits that the extension works on

* `max_version_...` is the first version which will break compatibility and the min version of the following release

dni avatar Aug 08 '24 09:08 dni

The logical extrapolation is as follows:

  • min_version_... is the lowest version of LNbits that the extension works on

  • max_version_... is the last version of LNbits that the extension works on

The confusion is clear.

deprecated_from_lnbits_version (or similar) create no confusion.

motorina0 avatar Aug 08 '24 10:08 motorina0

add to src/index.jsx:

        Maximum LNbits version:{" "}
        {ext.max_lnbits_version || "0.0.0"}
        <br />

motorina0 avatar Sep 05 '24 09:09 motorina0

add to check.py:

self.max_lnbits_version = ext.get("max_lnbits_version")

#...

max_lnbits_version = config.get("max_lnbits_version")
print(f"- max_lnbits_version : {max_lnbits_version}")
if max_lnbits_version != self.max_lnbits_version:
    return (
        False,
        f"max_lnbits_version mismatch: {max_lnbits_version} != {self.max_lnbits_version}",
    )

motorina0 avatar Sep 05 '24 10:09 motorina0