Skip to content

feat(app): improved custom node loading #7698

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

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

psychedelicious
Copy link
Collaborator

Summary

When we adopt the @skunkworxdark 's metadata nodes in #7697 , we create an unpleasant user experience for those who have the custom node pack installed already. Invoke will fail to start up because there is an error during custom node loading - in this case, because the nodes already exist.

This PR changes how custom node loading works to avoid this. Any error during custom node loading is now logged and we bail out of loading that node pack. Other node packs are still loaded, and the app will work even if a custom node errors.

Also improved messages for node registration errors and custom node loading.

Related Issues / Discussions

n/a

QA Instructions

This test only works once #7697 is merged and this PR is rebased on main.

On main, we expect Invoke to not start up at all.
On this PR, we expect an error to be logged and Invoke to start up just fine.

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations labels Feb 27, 2025
@psychedelicious psychedelicious mentioned this pull request Feb 27, 2025
9 tasks
@psychedelicious psychedelicious enabled auto-merge (rebase) February 27, 2025 01:30
Previously, custom node loading occurred _during module imports_. A consequence of this is that when a custom node import fails (e.g. its type clobbers an existing node), the app fails to start up.

In fact, any time we import basically anything from the app, we trigger custom node imports! Not good.

This logic is now in its own function, called as the API app starts up.

If a custom node load fails for any reason, it no longer prevents the app from starting up.

One other bonus we get from this is that we can now ensure custom nodes are loaded _after_ core nodes.

Any clobbering that may occur while loading custom nodes is now guaranteed to be a custom node clobbering a core node's type - and not the other way round.
@psychedelicious psychedelicious force-pushed the psyche/feat/app/improved-custom-node-loading branch from 6050d35 to eb00516 Compare February 27, 2025 01:30
@psychedelicious psychedelicious merged commit 4e8ce4a into main Feb 27, 2025
15 checks passed
@psychedelicious psychedelicious deleted the psyche/feat/app/improved-custom-node-loading branch February 27, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants