Fix/loader regressions 3114 3173 3144#3179
Conversation
…abs#3114) - automate: use EngineConfig.RequiresMainThread ?? false (was ?? true) - clean: use cmd.Engine?.Clean ?? false (was hardcoded true) Matches legacy genericcomps.py lines 522, 610-612.
…bs#3173) - Filter SVG from icon selection via IsRenderable() check - Add early-return guard in LoadBitmapSource for .svg files - Raster icons (png/ico/jpg) are preferred when both exist Legacy loader only ever looked for icon.png.
…s#3144) Add Environment.ExpandEnvironmentVariables() before Path.GetFullPath() in GetExtensionRoots(). Matches legacy os.path.expandvars() behavior. Fixes paths like %%USERPROFILE%%\Documents\MyExtensions.
|
@devloai , please review the changes and report. |
There was a problem hiding this comment.
Review Summary
Three fixes targeting real bugs (#3114, #3173, #3144). The ExtensionParser env-var expansion and the IconManager SVG-filtering approach are both conceptually correct, but I found two issues worth addressing before merging.
✅ ExtensionParser — Environment.ExpandEnvironmentVariables (#3144)
Clean one-liner fix. Exactly the right API for %USERPROFILE%-style paths.
⚠️ IconManager — SVG skip (#3173)
Approach is sound (GetBestIconForSizeWithTheme + IsSvgIcon helper), but there's a null-dereference risk in LoadBitmapSource — see inline comment.
⚠️ CommandTypeGenerator — clean engine / Dynamo defaults (#3114)
The useCleanEngine refactor has a logic issue: after the change both useCleanEngine and explicitlyRequiresCleanEngine are the same expression, making the comment ("Default is true") stale and the else if branch unreachable. Please clarify intent and simplify — see inline comment.
dev/pyRevitLoader/pyRevitAssemblyBuilder/AssemblyMaker/CommandTypeGenerator.cs
Outdated
Show resolved
Hide resolved
dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/IconsHandling/IconManager.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
PR Summary:
This PR fixes three loader regressions:
- CommandTypeGenerator: Changes
cleanand Dynamoautomateengine defaults tofalse(matching legacy behavior) - IconManager: Skips SVG icons that
BitmapImagecannot render, preventing silent failures - ExtensionParser: Expands
%ENV_VARIABLES%in user extension paths before path resolution
Review Summary:
The SVG and environment variable fixes are clean and straightforward. However, the CommandTypeGenerator changes introduce two logic issues worth addressing. The LoadBitmapSource SVG guard has a null-dereference risk since it calls imagePath.EndsWith() before the existing null guard. In BuildEngineConfigs, both useCleanEngine and explicitlyRequiresCleanEngine were made identical expressions, making the rocket-mode conditional logic non-functional. Additionally, the Dynamo automate default change (from true to false via RequiresMainThread) silently inverts existing behavior and needs explicit documentation.
Follow-up suggestions:
dev/pyRevitLoader/pyRevitAssemblyBuilder/UIManager/IconsHandling/IconManager.cs
Show resolved
Hide resolved
dev/pyRevitLoader/pyRevitAssemblyBuilder/AssemblyMaker/CommandTypeGenerator.cs
Show resolved
Hide resolved
dev/pyRevitLoader/pyRevitAssemblyBuilder/AssemblyMaker/CommandTypeGenerator.cs
Show resolved
Hide resolved
|
@devloai Please review, the updates. |
1b02407 to
b2c89ee
Compare
|
Thanks for the ping! Here's the updated status after reviewing the latest commit ( ✅ Resolved
|
@devloai |
|
Thanks for the detailed evidence chain — that fully satisfies the concern. ✅ Dynamo default ( Only remaining nit: the stale comment on // Default is false (matches legacy cached-engine behavior).
bool useCleanEngine = cmd.Engine?.Clean ?? false;Otherwise the logic is solid — good catch on all three regressions. |
b2c89ee to
9d1b93a
Compare
|
@devloai Review the latest commits |
There was a problem hiding this comment.
Review of latest commits (up to f21541d)
✅ Previous Issues — All Resolved
| Issue | Status |
|---|---|
IconManager.cs — null guard ordering (NullReferenceException) |
✅ Fixed |
| Rocket-mode dead code removed | ✅ Fixed |
Stale comment "Default is true" in CommandTypeGenerator.cs |
✅ Fixed — comment now correctly says "Default is false" |
Dynamo RequiresMainThread ?? false default |
✅ Confirmed correct (see discussion) |
🆕 New commit: f21541d — "Pass revitYear to ParseComponents function"
This is a legitimate and necessary fix. Without it, the min_revit_version / max_revit_version component-level gates in ParseComponents (line 1290) were always evaluated with revitYear = 0 (the default), effectively disabling version filtering for all components under ParseExtension. The fix correctly threads revitYear through the call chain:
ParseExtension(revitYear) → ParseComponents(..., revitYear) → IsRevitVersionCompatible(...)
ParseComponents already propagates it recursively to children at line 1127, so the fix is complete. No issues found.
Summary
The PR is ready to merge. All three original regressions (#3114, #3173, #3144) are properly fixed, and the new revitYear propagation fix is a clean and correct addition.
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26076+0001-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26077+2319-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26079+2333-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26080+1314-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2031-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2042-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2045-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2048-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2106-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2130-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26086+2004-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26088+1318-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26089+1231-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26090+0549-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1533-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1536-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1540-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1540-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1556-wip |
|
📦 New public release are available for 6.2.0.26090+1754 |
Name of your PR
Description
fix: Dynamo engine defaults, SVG icon fallback, env var expansion (#3114, #3173, #3144)
Checklist
Related Issues
Additional Notes
Include any additional context, screenshots, or considerations for reviewers.
Thank you for contributing to pyRevit! 🎉