Skip to content

SOF-8032: TS + new ide - #8

Open
k0stik wants to merge 5 commits into
mainfrom
fix/SOF-8032
Open

SOF-8032: TS + new ide#8
k0stik wants to merge 5 commits into
mainfrom
fix/SOF-8032

Conversation

@k0stik

@k0stik k0stik commented Aug 28, 2026

Copy link
Copy Markdown
Member

No description provided.

k0stik added 5 commits August 28, 2026 18:51
… [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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant