After an error itโ€™s possible to get trapped in an unrecoverable error state

Created on 27 February 2025, 5 months ago

Overview

Itโ€™s possible to get trapped in an unrecoverable error state in the XB UI.

Adding modifying the layoutModel in such a way that the POST to /xb/api/layout/{entitytype}/{entityId} returns an error, we show a modal alert.

Clicking Try again and thus re-requesting the preview endpoint wonโ€™t fix it, the issue is server side.
Refreshing the page wonโ€™t fix it - the erroring layout/model is now autosaved which means that refreshing the page just brings it back.
If the user was able to press Undo and THEN re-request the preview endpoint they might get unstuck, but if they refresh the page, they would lose the undo history and become stuck again.
The user canโ€™t access the preview UI/layers panel to remove the offending component themself because the alert is modal.
You canโ€™t remove pending autosaves from the Publish/Review button (I donโ€™t know if you will be able to do this in future?).

Proposed resolution

Obviously in an ideal world we'd fix the causes of the crash! But some ideas

  1. Add an undo call to the callback function the Try again button calls.
  2. Display the error in a non-modal way.
  3. If the POST to /xb/api/layout/{entitytype}/{entityId} doesn't successfully return preview markup due to an error, then don't create an auto-save so at least the user can reload the page.

User interface changes

๐Ÿ› Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom jessebaker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jessebaker
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom jessebaker

    ๐Ÿ“Œ Recover from server-side errors that may happen during rendering preview Active does a good chunk of work towards this

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    What about errors in (more complex) code components? Is that intended to be handled here, too? (Previously identified this in #3485878-15: Component previews should NEVER be able to render errors, should fall back to a meaningful error instead โ†’ , but perhaps this issue is a better place to discuss it.)

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • Assigned to balintbrews
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    โœจ Creating a page generates the URL path dynamically when editing. Active landed, which is how this actually was pretty easy to trigger until recently ๐Ÿ˜…

    I know @balintbrews is working to add hardening in multiple places, and some have already landed. @balintbrews, do you think that this issue can be marked as a duplicate of some other? ๐Ÿคž

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States effulgentsia

    It's possible this is already at a state that's good enough for beta, but in case it isn't I'm tagging this as a beta blocker to make sure we evaluate it before releasing a beta.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    I do not currently know of any remaining way to get to such a state. @mayur-sose, do you know of one?

  • @wim-leers, below is the one :

    1. Create a new code component.
    2. Add the component to the library and place it on the canvas.
    3. Go to Layers, click on the three dots, and select Edit code.
    4. After that, try to delete the component from Layers.
    5. You will see the following error:

      An unexpected error has occurred in a route. 404 Not Found

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Ah, that's the detail that was missing! We've already got an explicit bug report for that: ๐Ÿ› ContentCreatorVisibleXbConfigEntityAccessControlHandler bypasses admin permissions for view Active .

    Thanks, much appreciated!

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    @mayur-sose You wrote "below is the one" โ€” does that mean it's the only way you were able to get trapped? ๐Ÿคž

  • Iโ€™m investigating whether there are any other situations where users can get trapped. I will update you if I find any.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Great, thanks! ๐Ÿ™ I hope you'll fail, for all our sakes ๐Ÿ˜œ๐Ÿ˜„

  • ๐Ÿ‡ช๐Ÿ‡ธSpain penyaskito Seville ๐Ÿ’ƒ, Spain ๐Ÿ‡ช๐Ÿ‡ธ, UTC+2 ๐Ÿ‡ช๐Ÿ‡บ

    I can reproduce #8 and has nothing to do with the other issue mentioned in #9.

    See my amend to #8:

    1. Create a new code component.
    2. Add the component to the library and place it on the canvas.
    3. Go to Layers, click on the three dots, and select Edit code.
    4. After that, try to delete ANY component from Layers.
      You will see the following error:
    5. An unexpected error has occurred in a route. 404 Not Found

    This happens even if I'm deleting something that is not what I'm seeing in the editor.
    But surprisingly only happens if I have that component in the editor.

    The difference is that if I create a new editor, my url is: xb_page/1/code-editor/code/test.
    But if I edit a placed component code, my url is: xb_page/1/code-editor/component/jjj

    (see component instead of code).

    When I delete a component, even if it's not the one selected, i go from

    xb/xb_page/1/editor/component/0b914052-f057-4a94-81db-bb64a09850e3 to xb/xb_page/1/editor (removing the component/{uuid}).

    I think we are trying to do the same here, but ending in xb_page/1/code-editor which is a wrong url (you can just go directly in the browser and will see the same error Majur indicated)

    Maybe there's something checking a regex component/{whatever} without checking a) that whatever is a uuid or, b) that we are at /editor/component/{whatever} (ensuring no match with /code-editor/component/{whatever}

  • ๐Ÿ‡ช๐Ÿ‡ธSpain penyaskito Seville ๐Ÿ’ƒ, Spain ๐Ÿ‡ช๐Ÿ‡ธ, UTC+2 ๐Ÿ‡ช๐Ÿ‡บ

    Per #13, unpostponing.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Related but more obscure way to get trapped: ๐Ÿ› After source session timeout, XB page stuck on the error message Active .

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    We've made improvements to the error handling to avoid this from happening in more cases. Discussed with some of the XB folks that we will be opening issues for specific instances where this happens in case that we run into those in future.

Production build 0.71.5 2024