SOF-8032: TS + new ide - #8
Open
k0stik wants to merge 5 commits into
Open
Conversation
… [release] renderWarnings()/renderErrors() assumed every computedEntity implements .warnings/.errors and crashed with "Cannot read properties of undefined (reading 'filter')" otherwise. This started happening for every job after web-app's ide dependency dropped its warnings fallback (commit 17e163b), on the assumption web-app's own imports/jobs/job.ts would supply a real override - that file has since been deleted entirely as part of the Job DAO/use-case migration, so nothing provides .warnings at all anymore, and jode's Job/web-app's CoreJob never implemented .errors/.warnings either. Reproducible in job-designer's own standalone demo too (a bare jode Job has neither field), so this isn't web-app-specific wiring - the mixin itself needs to tolerate an optional field being absent.
…rent types [release] Converts the remaining .js/.jsx files (Compute, ComputeHandler, Notify, StatusTrackTable, mixins, validators) to real TypeScript, typed against @mat3ra/ide's current ComputedEntityMixin<C>/InfrastructureMixin contracts rather than the loose, never-type-checked shape they had before (allowJs with no checkJs meant these files were transpiled but never validated). ComputableEntity now models errors as required (every real producer supplies it) and warnings as optional - making the actual current reality (no producer of .warnings exists anywhere in jode/CoreJob since ide dropped its fallback) part of the type contract, instead of a silent runtime assumption that crashed in production. Typing surfaced three more small, real bugs, fixed in place since each is confined to the file being converted: - Compute.jsx read job.workflow.usedApplicationNames[0] - workflow is the raw JSON schema field, not the live WodeWorkflow instance. jode's Job already exposes this directly as job.usedApplicationNames. - Notify.jsx read user.email in one branch instead of user.entity.email like every other identical call site in the file. - QueuesTable's Queue.capacity was typed as required, but esse's compute/queue schema never lists it in `required` - real Queue instances can have it undefined (this was also the root cause of a pre-existing type error in web-app's ClustersPage.tsx). Widened clusters_load.ts's queueStatus/getStatus to match; its `default` switch branch already degrades gracefully for an unmatched load/capacity pair. Also dropped two dead props (`adjustable`, `isDescriptionEditorHidden`) passed to cove's <EntityHeader> - neither exists in its real prop list, confirmed by reading its actual destructured signature. job-designer's Job.jsx (the sole consumer of ComputableEntityMixin) stays untyped JS - compile-time enforcement applies within ive itself here, not yet at the actual mixing call site.
Same issue as capacity in the prior commit: esse's compute/queue schema never lists displayName in required either, so real Queue instances can have it undefined too - this was the actual remaining cause of the ClustersPage.tsx type mismatch (capacity alone wasn't the full story).
…lease] Not exported from exports.ts, not referenced anywhere else in ive's own src/, and not imported via a deep path from job-designer, workflow-designer, materials-designer, or web-app - confirmed unreachable and unused.
…nings crash
Mixes ComputableEntityMixin into a plain React.Component and calls
renderWarnings()/renderErrors() directly with a computedEntity that has no
.warnings field, reproducing the exact production crash ("Cannot read
properties of undefined (reading 'filter')") without needing a DOM or the
full job-designer/web-app rendering stack.
Verified genuine: temporarily reverted the `?? []` defensive default back
to a bare `this.computedEntity.warnings!` and confirmed the test fails at
the exact throwing line with the exact reported error, then restored the
fix and confirmed all tests pass again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.