Skip to content

UniqueMediaPathScheme returns non unique paths for different Guids #19377

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

Open
PeterKvayt opened this issue May 21, 2025 · 2 comments
Open

UniqueMediaPathScheme returns non unique paths for different Guids #19377

PeterKvayt opened this issue May 21, 2025 · 2 comments
Labels

Comments

@PeterKvayt
Copy link
Contributor

PeterKvayt commented May 21, 2025

Which Umbraco version are you using?

15.3.0

Bug summary

I have faced a case where for 2 different guids that are used in UniqueMediaPathScheme as itemGuid argument GetFilePath method returns the same value.

Specifics

Guides:

  • 01966324-bcf3-7bce-b9ae-72108866a6dd
  • 01966324-00f3-71b8-a9b0-be56c4a7eb46

Steps to reproduce

Try to call method GetFilePath with the following args:

  • fileManager (it does not matter)
  • itemGuid: get from "Specifics"
  • propertyGuid: use the same value for both guids from specifics, e.g. 01966322-d085-7cd1-b4a2-0264552bd634
  • filename: use the same value for both guids from specifics, e.g. foo.txt

For two guides the specific result will be the same - ayaaaadw/foo.txt

Expected result / actual result

I do not know it is correct behaviour or not.
I think it is not, because if we have 2 umb docs with the same uploaded files, then these files will be saved under the same folder and if one umb doc will be deleted, then it will affect the other one - it will lose its file (because file names are the same and them were stored under the same folder).

This case was found using Guid.CreateVersion7().

Since we can create umb documents programmatically and set any Key for nodes, it might leads to these issues above.

Copy link

Hi there @PeterKvayt!

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 🤖 🙂

@AndyButland
Copy link
Contributor

I'll just add for now that this isn't completely unexpected - see comment on the implementation of IMediaScheme. There's a balance between unnecessarily long folder names and avoiding potential clashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants