Skip to content

[Bug] Legacy model restore warnings are ignored by the upload UI #420

@lil-aditya

Description

@lil-aditya

Summary

Uploading an older model archive can succeed on the backend but appear to do nothing in the browser.

For legacy archives, the backend intentionally returns a warning response from API/Routes/Upload/UploadRoute.py with a payload like status_code: "warning" plus message_warning. However, the upload success handler in WebAPP/Classes/Base.Class.js does not handle that warning path, so the UI does not append the restored model, does not close the restore modal, and does not show the upgrade guidance.

As a result, users can successfully restore a legacy model on disk but think the restore failed because the frontend never reflects the completed action.

Expected behavior

If the backend returns a restore response with:

  • status_code: "warning"
  • a valid casename
  • a legacy-upgrade message_warning

the frontend should still treat the restore as successful and:

  • add the restored model to the list
  • close the restore modal
  • show the success message
  • also show the upgrade warning / migration guidance

Only non-restoring warnings such as "model already exists" should remain warning-only and avoid mutating the UI.

Reproduction steps

  1. Start the application locally.
  2. Open the "Restore" / upload modal for case archives.
  3. Upload a legacy model archive that triggers the backend legacy-warning path, such as a model with osy-version 4.0, 4.5, or 4.9.
  4. Wait for the upload request to complete successfully.
  5. Observe that the backend returns a warning restore response, but the frontend does not add the model to the UI and does not close the modal.

Optional verification:

  1. Inspect the network response for the upload request.
  2. Confirm the response contains status_code: "warning", casename, and message_warning.
  3. Compare that with the browser behavior, which remains unchanged.

Environment

  • OS: Windows
  • Browser: Chromium-based browser (Chrome / Edge)
  • App state: reproduced on main before applying a frontend fix
  • Relevant frontend file: WebAPP/Classes/Base.Class.js
  • Relevant backend file: API/Routes/Upload/UploadRoute.py

Logs or screenshots

Example backend response payload:

{
  "response": [
    {
      "message_warning": "You have restored a model created in a earlier version...",
      "message": "Model LegacyModel have been uploaded!",
      "status_code": "warning",
      "casename": "LegacyModel"
    }
  ]
}

Observed frontend behavior after this response:

no restored model is appended to the case list
restore modal stays open
upgrade warning is not surfaced to the user

Related work checked

I checked the current restore / archive-related work and did not find an issue specifically covering the frontend warning-handling gap for legacy restores.

Related areas reviewed:

  • backend restore response handling in API/Routes/Upload/UploadRoute.py
  • frontend upload success handling in WebAPP/Classes/Base.Class.js
  • recent archive / zip / restore-related work does not appear to address this specific UI behavior gap

Proposed track

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions