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

Combine GetUrl requests when loading a MNTP with many entries #11207

Merged
merged 3 commits into from
Oct 6, 2021

Conversation

p-m-j
Copy link
Contributor

@p-m-j p-m-j commented Sep 27, 2021

When loading MNTP's in the backoffice with existing entities associated, a request was made per entity to umbraco/backoffice/UmbracoApi/Entity/GetUrl

All URLs are now resolved in a single request.

Tested

  • Media
  • Content (including vary by culture URL changes, items in recycle bin)
  • Members (no urls expected to render)

image

Paul Johnson added 2 commits September 27, 2021 14:36
Enables loading multiple URLs in a single request for Media & Documents
@p-m-j p-m-j added the state/in-sprint We've committed to work on this during the sprint indicated in the milestone label Sep 27, 2021
@p-m-j p-m-j marked this pull request as draft September 28, 2021 07:09
@p-m-j
Copy link
Contributor Author

p-m-j commented Sep 28, 2021

Requires both udi and integer id support

@p-m-j p-m-j marked this pull request as ready for review September 28, 2021 08:53
@nul800sebastiaan
Copy link
Member

I can't see anywhere where we're still handling int ids @p-m-j - I feel like that's been deprecated in v8.0.0 but I am not 100% sure. Maybe @bjarnef can remember for sure, he's been working on Udi support a lot!

@bjarnef
Copy link
Contributor

bjarnef commented Sep 28, 2021

I think mostly it was because old pickers stored int ids. I haven't checked i all pickers in v9 now stores udi and legacy pickers have been removed?

@nul800sebastiaan
Copy link
Member

This is for v8! I can't find code that handles int ids for MNTP any more in v8, nor are the legacy datatypes available any more so I believe it's safe to say that those will not work in v8 and that we don't need to anticipate them.

@bjarnef
Copy link
Contributor

bjarnef commented Sep 28, 2021

@nul800sebastiaan ahh sorry, just noticed @p-m-j was working on various PRs for v9 (but not this 😅 ).

Regarding udi there are a few places it would be great to support this as well:
https://github.com/umbraco/Umbraco-CMS/pulls?q=is%3Aopen+is%3Apr+author%3Abjarnef+udi

Maybe not for v8.17, but a later release on v8.

@nathanwoulfe
Copy link
Contributor

Might need to consider folks who have come from v7 and may have custom value converters to deal with large amounts of legacy pickers using IDs (aka people like me 🙄).

It's probably an edge case, and should be rectified by migrating the id-based data, but assuming UDI would cause issues for these people...

@p-m-j
Copy link
Contributor Author

p-m-j commented Sep 28, 2021

@nathanwoulfe yep that's exactly what we're trying to establish, is it possible to create a v7.5 site with integer based MultiNodeTreePicker (int), take it through 7.6 where there would be both MultiNodeTreePicker (int) and MultiNodeTreePicker2 (udi) onwards to 7.14 followed by 8.x still maintaining integers in the property data and if that is possible, how does it work with the current v8 MultiNodeTreePicker (udi) at present.

The upgrade process from 7.5 to 8.x isn't much fun even with a practically empty site so it's hard to establish whether we still need to support this.

@nathanwoulfe
Copy link
Contributor

Since it is possible to migrate id-based to UDI-based, maybe the solution would be adding a migration so that anyone landing on 8.17 will be doing so without IDs?

@p-m-j
Copy link
Contributor Author

p-m-j commented Sep 28, 2021

The confusion here is that since the v8 MultiNodeTreePicker only works with UDIs we're assuming that must have already been handled, see GetReferences in https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs

If you have a v8 site with a MultiNodeTreePicker that still has comma separated integers in the property data then that would prove we still need to handle somehow (via a migration path or adding additional routes for looking up a url map via integer ids)

Copy link
Contributor

@nikolajlauridsen nikolajlauridsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, only found a couple of minor things 👍

Copy link
Contributor

@nikolajlauridsen nikolajlauridsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just tested it out again and everything works as expected, I'll go ahead and merge 👍

@nikolajlauridsen nikolajlauridsen added category/performance Fixes for performance (generally cpu or memory) fixes release/8.18.0 labels Oct 6, 2021
@nikolajlauridsen nikolajlauridsen merged commit e36dd86 into v8/dev Oct 6, 2021
@nikolajlauridsen nikolajlauridsen deleted the v8/bugfix/mntp-performance branch October 6, 2021 06:56
@umbrabot umbrabot removed the state/in-sprint We've committed to work on this during the sprint indicated in the milestone label Oct 6, 2021
@p-m-j
Copy link
Contributor Author

p-m-j commented Nov 17, 2021

Sounds like we did indeed need support for integers #11631

@nul800sebastiaan
Copy link
Member

This is marked as breaking as it causes problems as described in #11631 - unfortunately we didn't get a chance to fix it before the 9.1.0 release, but we'll fix this in version 9.1.1.

@marcemarc
Copy link
Contributor

One of the problems is that in V9 assumption that the MultiNodeTreePicker only works with Udis!

This is for v8! I can't find code that handles int ids for MNTP any more in v8, nor are the legacy datatypes available any more so I believe it's safe to say that those will not work in v8 and that we don't need to anticipate them.

In fact... Macro Parameter Editors that use the MultiNodeTreePicker in V9 have been kept as storing integer ids...

... and although it's been suggested to update them to use Udis, it's been felt this could only really be done in V10, to avoid breaking changes! But in the meantime, everything has to take ints into consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/breaking category/performance Fixes for performance (generally cpu or memory) fixes release/9.1.0 type/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants