Skip to content

[GUI] Preserve initializer edits when save fails #2347

Description

@romanlutz

Important

Maintainer-owned: This issue is intentionally labeled not ready yet. Please leave implementation to a PyRIT maintainer unless a maintainer explicitly assigns or approves the work.

Describe the bug

When PUT /api/initializers/settings/{id} rejects an edit, the Edit initializer dialog closes immediately and discards the attempted form values. A page-level error appears, but the saved card retains the previous value; reopening the editor confirms that the user's input is gone.

The user must remember and reconstruct the failed edit before retrying. This is especially costly for initializers with several parameters because the failure removes both the recovery context and the attempted values. Severity: moderate, because saving is blocked and recovery requires re-entering data.

Steps/Code to Reproduce

  1. Open the Initializers page in the local frontend.
  2. Add a refresh_datasets initializer with days set to 9.
  3. Open that initializer's Edit dialog and change days to 13.
  4. Make the next PUT /api/initializers/settings/{id} request return HTTP 400 with a synthetic error message.
  5. Choose Save.
  6. Observe that the dialog closes and the card still shows 9.
  7. Reopen Edit and observe that the field contains 9; the attempted value 13 was discarded.
# N/A - GUI-only reproduction; no Python code is required.

Expected Results

The dialog should remain open, preserve 13, show and announce the save failure within the dialog, and allow the user to correct or retry the edit without reconstructing the form.

Actual Results

The dialog closes as soon as the failed request settles. The page shows a synthetic failure alert, the card remains at the saved value 9, and reopening the editor shows 9 rather than the attempted value 13. No sensitive traceback or provider data was involved; the reproduction used a synthetic local HTTP 400 response.

Screenshots

Sanitized screenshots and WebM evidence, showing only the application viewport and synthetic values/errors, are attached in the evidence comment below.

Versions

  • PyRIT commit: 3dd9946ee4ef08a2048c64ff4b29d3a856a8068e
  • OS: Windows_NT
  • Browser automation: Playwright Chromium (@playwright/test 1.62.0)
  • pyrit.show_versions(): N/A for this frontend-only reproduction

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIUmbrella label for all feedback submitted via the Co-PyRIT GUIbugSomething isn't workingnot ready yetThis issue needs more definition or is blocked by a pending change.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions