Skip to content

[FIX] Data input path loses a character when entered by fast automated input (Batch Run / Train Model) - #3797

Merged
Taras-Hlukhovetskyi merged 2 commits into
mlrun:developmentfrom
Taras-Hlukhovetskyi:ML-13196
Nov 11, 2026
Merged

Taras-Hlukhovetskyi merged 2 commits into
mlrun:developmentfrom
Taras-Hlukhovetskyi:ML-13196

Conversation

@Taras-Hlukhovetskyi

@Taras-Hlukhovetskyi Taras-Hlukhovetskyi commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

📝 Description

Fast automated input (Selenium send_keys) into the data input path of the Batch Run / Train Model wizard lost one character: the 53rd keystroke. The job then failed with HTTP Error 404 because it read a URL that doesn't exist. Typing or pasting by hand was not affected.
Root cause: React 19 changed how it detects infinite update loops. After each commit it counts a "nested update" while any Sync or Default work is still pending; React 18 only counted Sync work.

  • TargetPath updated fieldInfo (the value sent with the run) from a FormOnChange effect, which scheduled another render on every keystroke.
  • With no idle time between keystrokes, those renders never ran, so the counter kept growing.
  • At 51 React threw "Maximum update depth exceeded" inside the combobox onChange, before the new value was stored, and restored the previous input value.
  • This started in rc7 with the React 19 upgrade ([CHORE] Infrastructure: update libs, migrate to ESM, move DRC inside UI, fix react-hooks v7 lint #3791).
    Fix: TargetPath now applies typed input (and suggestion clicks) to the form directly in the change event: the path, fieldInfo and the saved MLRun store state. Scheme selection and changes made by the form itself still go through FormOnChange after render, as
    before, and the effect skips when fieldInfo already matches. So validation and error messages are unchanged.

🛠️ Changes Made

  • TargetPath.jsx
    • New changePathFieldInfo writes the path type, path value and dataInputState to the form.
    • handleOnChange calls it for typed input and suggestion clicks.
    • handlePathChange, the FormOnChange handler, skips when fieldInfo already matches the path.
    • A path without a scheme no longer throws (match(...) returning null).
  • targetPath.util.js: handleStoreInputPathChange also returns the MLRun store state it computes, so the change event can save it in the form.
  • Unit tests:
    • TargetPath.test.jsx (13): scheme selection and the required error, typing, validation, clearing, MLRun store suggestions at every level, the saved store state, scheme switching, programmatic path changes, editing an existing path, restoring saved state, forms without
      formStateDataInputState, and machine-speed HTTPS and store paths.
    • targetPath.util.test.js (2): handleStoreInputPathChange.
    • FormDataInputsTable.test.jsx (2): the ticket flow in the real data-inputs table at machine speed, and an MLRun store round trip (apply, reopen, edit).
    • FormOnChange.test.jsx (5): FormOnChange behaviour, plus a guard that its handler keeps running in a passive effect. Moving it to useLayoutEffect breaks validation in the Job wizard Resources step (FormResourcesUnits).

✅ Checklist

  • I have given the PR a well-structured title describing the domain and the specific change that was made
  • I tested the changes in the browser (locally or via preview build)
  • I confirmed that existing tests pass
  • I added or updated unit / integration tests (if needed)
  • I checked that this change doesn’t introduce new console warnings or lint / formatting errors
  • I updated the relevant Jira ticket with the appropriate details and status

🔗 References


🚨 Potentially Breaking Changes

  • Yes
  • No

Includes DRC change

  • Yes
  • No
    If yes -> requires bump NPM version

🔍 Additional Notes

  • Unit tests: all 39 files (518 tests) pass; lint, Prettier and the production build are clean. On the original code, only the machine-speed tests and the util tests fail. All the behaviour tests pass there too.
  • Browser (Chrome, Playwright against the mock server):
    • Sending all keystrokes at once (as Selenium send_keys does) reproduced the bug on the original code: machine-sped-input, and submit_job sent the wrong inputs.dataset. With the fix the path is kept and submitted exactly.
    • A 9-scenario regression run over all TargetPath places gave identical results on the original and the fix (58 recorded steps). It covered every scheme, validation, editing, paste, scheme switching, discard, MLRun store suggestions, Run payloads, Train model, Register
      artifact and Register model.
  • E2E: the 26 Cucumber scenarios that touch the path field pass:
    npm run test:ui -- tests/features/artifacts.feature:125:203:354:729:757 tests/features/datasets.feature:198:272:416:681:717:946:1420 tests/features/jobsAndWorkflows.feature:1213:1445:2233:2672 tests/features/models.feature:288:381 tests/features/projectMonitoring.feature:294:345:391:436 tests/features/quickActions.feature:82:184:274:376
  • Other path fields: the Create feature set URL fields (UrlPath) are not affected; they update state in the change event. Both were checked in Chrome at machine speed.
  • Scope: this follows React's recommendation to derive values in event handlers rather than in effects. Any other place that writes form or state values from an effect on every keystroke could hit the same React 19 limit under automated input. No other text field does
    this today.
  • Known issue (unrelated, also on the original code): in the Register Artifact dialog, clicking the scheme selector right after the dialog opens can render the dropdown out of view, probably because of the dialog's open animation.

📸 Screenshots / Demos

N/A: no visual changes.

@Taras-Hlukhovetskyi Taras-Hlukhovetskyi self-assigned this Nov 10, 2026
@Taras-Hlukhovetskyi Taras-Hlukhovetskyi added bug Something isn't working tests javascript Pull requests that update javascript code labels Nov 10, 2026
@Taras-Hlukhovetskyi
Taras-Hlukhovetskyi merged commit 25bf1c5 into mlrun:development Nov 11, 2026
5 checks passed
@Taras-Hlukhovetskyi
Taras-Hlukhovetskyi deleted the ML-13196 branch November 11, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working javascript Pull requests that update javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants