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

Duplicate Document Names Overwrite Each Other on Property Documents Tab #5446

Open
paulo-rossy opened this issue Nov 8, 2024 · 1 comment
Assignees

Comments

@paulo-rossy
Copy link
Contributor

Bug: Duplicate Document Names Overwrite Each Other on Property Documents Tab

Description:

When adding documents on the "Property" tab (<baseUrl>/property/<propertyId>), files with identical names overwrite each other, leading to unexpected behavior and 500 error.

Reproduction Cases:

  1. Adding two documents with the same name:

    • Steps:
      1. Upload a document with a specific name (e.g., "document.pdf").
      2. Upload another document with the same name.
      3. Delete the second document.
    • Result: When attempting to download the first document, the user is redirected to <baseUrl>/api/files/document/<documentName>, which returns a 500 error.
  2. Adding documents with the same name in different properties:

    • Steps:
      1. Upload a document with a specific name (e.g., "document.pdf") to one property.
      2. Upload a different document with the same name to another property.
    • Result: The file is overwritten, causing one document to replace the other, despite them being associated with different properties.
    • Issue: If the document is deleted in one property, it still appears in the other, but navigating to it leads to a 500 error.

Proposed Solution:

To prevent overwriting, append the property address to the document's file name upon upload, ensuring unique identifiers for each file.


Thank you for looking into this issue!

@toplenboren toplenboren self-assigned this Nov 11, 2024
@toplenboren
Copy link
Member

toplenboren commented Nov 15, 2024

Hello! Thanks for the bug report 🚀

We have encountered a similar error recently and fixed it in one of recent patches. Can you please check whether the fix works for you?

By the way, what FileAdapter do you use?

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

No branches or pull requests

2 participants