Flexget / webui

The FlexGet Web UI
MIT License
42 stars 19 forks source link

Version 3.9 release causes web ui to render blank due to Semver check failing #182

Closed shawnphoffman closed 1 year ago

shawnphoffman commented 1 year ago

Expected behaviour:

Version check shouldn't cause the page to crash. The web UI should either use loose checking or flexget proper should use the full x.x.x versioning.

Actual behaviour:

Web UI v2 doesn't load. The latest flexget 3.9 version is causing the Semver check to fail since 3.9 isn't fully semver compliant. You can coerce it in the UI to get things working and prevent it from happening in the future. Something like this inside Version.tsx

const coercedLatestVersion = coerce(latestVersion).format();
...
gt(coercedLatestVersion, normalizedVersion)

Or, enforcing full semver versions on flexget proper would accomplish the same.

Steps to reproduce:

Config:

N/A

Screenshots:

image image

Log:

(click to expand) ``` react-dom.production.min.js:196 TypeError: Invalid Version: 3.9 at new l (semver.js:41:13) at e.exports (compare.js:3:3) at e.exports (gt.js:2:29) at Ot (Version.tsx:25:10) at ca (react-dom.production.min.js:154:98) at $a (react-dom.production.min.js:174:273) at Es (react-dom.production.min.js:261:312) at gu (react-dom.production.min.js:230:22) at hu (react-dom.production.min.js:229:362) at ou (react-dom.production.min.js:223:216) overrideMethod @ console.js:213 ds @ react-dom.production.min.js:196 Ss.n.callback @ react-dom.production.min.js:210 _o @ react-dom.production.min.js:131 bo @ react-dom.production.min.js:131 bu @ react-dom.production.min.js:252 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ui @ react-dom.production.min.js:120 yu @ react-dom.production.min.js:244 ou @ react-dom.production.min.js:223 (anonymous) @ react-dom.production.min.js:121 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ui @ react-dom.production.min.js:120 Gi @ react-dom.production.min.js:121 $i @ react-dom.production.min.js:120 eu @ react-dom.production.min.js:214 La @ react-dom.production.min.js:163 (anonymous) @ hooks.tsx:10 u @ runtime.js:45 (anonymous) @ runtime.js:271 forEach.e. @ runtime.js:97 bt @ main.cce4d52f6988bfadab4f.js:1 i @ main.cce4d52f6988bfadab4f.js:1 Promise.then (async) bt @ main.cce4d52f6988bfadab4f.js:1 i @ main.cce4d52f6988bfadab4f.js:1 (anonymous) @ main.cce4d52f6988bfadab4f.js:1 (anonymous) @ main.cce4d52f6988bfadab4f.js:1 (anonymous) @ hooks.tsx:7 (anonymous) @ hooks.tsx:13 ps @ react-dom.production.min.js:198 Cu @ react-dom.production.min.js:255 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ui @ react-dom.production.min.js:120 wu @ react-dom.production.min.js:254 ou @ react-dom.production.min.js:223 (anonymous) @ react-dom.production.min.js:121 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ui @ react-dom.production.min.js:120 Gi @ react-dom.production.min.js:121 $i @ react-dom.production.min.js:120 eu @ react-dom.production.min.js:214 La @ react-dom.production.min.js:163 (anonymous) @ Login.tsx:17 u @ runtime.js:45 (anonymous) @ runtime.js:271 forEach.e. @ runtime.js:97 $ @ 14.18cf3ab07df2cff9c980.js:1 i @ 14.18cf3ab07df2cff9c980.js:1 Promise.then (async) $ @ 14.18cf3ab07df2cff9c980.js:1 i @ 14.18cf3ab07df2cff9c980.js:1 (anonymous) @ 14.18cf3ab07df2cff9c980.js:1 (anonymous) @ 14.18cf3ab07df2cff9c980.js:1 (anonymous) @ Login.tsx:14 (anonymous) @ Login.tsx:20 ps @ react-dom.production.min.js:198 Cu @ react-dom.production.min.js:255 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ui @ react-dom.production.min.js:120 wu @ react-dom.production.min.js:254 ou @ react-dom.production.min.js:223 (anonymous) @ react-dom.production.min.js:121 t.unstable_runWithPriority @ scheduler.production.min.js:18 Ui @ react-dom.production.min.js:120 Gi @ react-dom.production.min.js:121 V @ scheduler.production.min.js:17 O.port1.onmessage @ scheduler.production.min.js:14 Show 1 more frame Show less main.cce4d52f6988bfadab4f.js:1 Uncaught (in promise) TypeError: Invalid Version: 3.9 at new l (semver.js:41:13) at e.exports (compare.js:3:3) at e.exports (gt.js:2:29) at Ot (Version.tsx:25:10) at ca (react-dom.production.min.js:154:98) at $a (react-dom.production.min.js:174:273) at Es (react-dom.production.min.js:261:312) at gu (react-dom.production.min.js:230:22) at hu (react-dom.production.min.js:229:362) at ou (react-dom.production.min.js:223:216) ```

Additional information:

gazpachoking commented 1 year ago

Well, the good news is that this'll be fixed next release. And we'll have to refrain from dropping the patch version on next release. I think probably the parser on webui side should also be looser and assume a missing version component is 0, but I'm not familiar with the webui codebase or how we even do releases on this side. Someone fixing that up in a PR would be welcome.

shawnphoffman commented 1 year ago

@gazpachoking I updated the original bug to include a rough example of how to coerce x.x into x.x.x on the frontend. I don't have the codebase locally right now but I can try to get it up and running.

but I'm not familiar with the webui codebase or how we even do releases on this side

This issue is related to the flexget proper versioning, not the webui. It's pulling the version from the server and trying to see if the user should update their server or not.