Skip to content

Add-node form hides a failed elements request #59

Backlog

Description

@vadim9999

Steps to reproduce

  1. Start the editor with the backend stopped, or make GET /elements return an error.
  2. Open the template tree and choose Add on a node (the form in AddElementForm).
  3. Open the Element select.

Expected behavior

A notification "Could not load the elements" (via notifyError), as in Elements.tsx, Main.tsx and TemplateTree.tsx.

Actual behavior

The select is empty with no message. getAllElements() in src/editor/Main/TemplateTree/AddElementForm/AddElementForm.tsx:42 has no .catch, so the failure becomes an unhandled promise rejection that only shows in the console.

useEffect(() => {
  getAllElements().then((data) => {
    setElements(data);
  });
}, []);

Fix: add .catch(notifyError("Could not load the elements")) and a Vitest test that mocks getAllElements to reject and checks the notification.

Area

Editor UI: template tree (AddElementForm)

Environment

master at e858879. Found while reviewing #55; split out of #58 because that issue covers tests only.

Activity

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions