Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15 - Race condition breaks navigation between documents #17758

Open
kraftvaerk-chth opened this issue Dec 9, 2024 · 1 comment
Open

V15 - Race condition breaks navigation between documents #17758

kraftvaerk-chth opened this issue Dec 9, 2024 · 1 comment
Assignees
Labels
area/frontend category/front-end state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks type/bug

Comments

@kraftvaerk-chth
Copy link

kraftvaerk-chth commented Dec 9, 2024

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

15.0.0

Bug summary

There is a race condition in the backoffice, that causes navigation between documents to break
The error happens only when different data types of different properties are loaded with a sizable delay

Specifics

No response

Steps to reproduce

  1. Create a new document type with at least 2 fields
    The 2 fields should use different data types with different property editor UI's - for examle a Tiptap RTE editor (Umb.PropertyEditorUi.Tiptap) and a Content Picker (Umb.PropertyEditorUi.DocumentPicker)

  2. Create 2 documents with this document type, and name them something different so you can tell them apart

  3. Copy the ID of one of the 2 data types used in one of the properties, and insert the following middleware in Program.cs. Make sure to replace the <xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx> part with the ID of the data type

app.Use(async (context, next) =>
    {
        if (context.Request.Path.ToString().StartsWith("/umbraco/management/api/v1/data-type/<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>")
            || (context.Request.Path.ToString().StartsWith("/umbraco/management/api/v1/item/data-type")
                && context.Request.QueryString.ToString().Contains("<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>")))
        {
            await Task.Delay(800);
        }

        await next();
    })
    .UseUmbraco()
    .WithMiddleware(u =>
    {
        u.UseBackOffice();
        u.UseWebsite();
    })
    .WithEndpoints(u =>
    {
        u.UseBackOfficeEndpoints();
        u.UseWebsiteEndpoints();
    });

await app.RunAsync();
  1. Rebuild and restart the application and navigate to one of the documents. You should now see an error like this in the browser console:
Uncaught (in promise) Error: Editor Alias of "ca90c950-0aff-4e72-b976-a30b1ac57dad" not found.
    at jt.setPropertyValue (document-workspace.context.ts:473:10)
  1. Navigate from one document to the other, you will see that the page is "stuck" on the previous document, and you can no longer navigate to other documents

Explanation for step 3:
We of course do not have this delay in our code, but we do experience from time to time in our test environment that one request may be slightly delayed compared to another, which may cause this race condition to occur when navigating between documents
The inserted middleware with an explicit delay for only 1 of the 2 data types used, will help reliable re-create the scenario where the race condition occurs
If you are running this scenario on your localhost with a local DB with an extremely small latency, you will almost never be able to replicate this scenario, unless you add the delay artificially - but in our test environment it happens from time to time naturally when the server has a bit of traffic

Expected result / actual result

Expected result: Navigating between documents should work every time, regardless of any delays in individual requests

Actual result: Navigation gets stuck if there is a sizable delay between 2 data types being loaded from the server


This item has been added to our backlog AB#47239

Copy link

github-actions bot commented Dec 9, 2024

Hi there @kraftvaerk-chth!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend category/front-end state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks type/bug
Projects
None yet
Development

No branches or pull requests

2 participants