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

Inconsistent files collection storage #7529

Open
txau opened this issue Dec 6, 2024 · 3 comments
Open

Inconsistent files collection storage #7529

txau opened this issue Dec 6, 2024 · 3 comments

Comments

@txau
Copy link
Collaborator

txau commented Dec 6, 2024

Manually inspecting a couple of DBs (CEJIL, IHRDA), a series of inconsistent patterns have been found:

  • Some files have mimetype defined, others don't. Particularly in CEJIL there are PDF files without mimetype
  • Some files defined as "attachment" (as opposed to "document") have document like metadata (TOC, language, content, etc), while others don't. I wonder what is the cause for this difference.

I do not know at the moment the possible pathway for these discrepancies in how files are stored in the DB, maybe this is working as intended. I suggest we double check.

@aphilop
Copy link

aphilop commented Dec 9, 2024

This needs further investigation from the backend team @huridocs/backend

@RafaPolit
Copy link
Member

We know that, at some point, we stopped storing mimetypes and then we resumed storing them. So, for older collections, I believe it is expected that files uploaded at a certain stage could not have a mimetype defined. I don't think this has any downside effect.

The second part if more confusing, maybe some main documents got demoted to attachments at some point somehow? @daneryl points out that OCR process does, indeed, demote files from main files to attachments, in order to keep the original document. If that document is OCRed after the process of automatic TOC, then attachments could indeed have this un-expected properties. This one we need to check.

Still, is this causing any problems or was this just discovered by analyzing the database?

@txau
Copy link
Collaborator Author

txau commented Dec 9, 2024

Regarding the first case, maybe that is what was causing inconsistent behavior in the download button? It needs to be confirmed but maybe the fact that it does not have mimetype affects whether the file is downloaded directly or opened in the browser? Apart from that I don't see any downside except potential future problems if the mimetype is used for something.

Regarding the second case, it could be but if OCR is run on a file then automatic TOC was not preformed on that file. As far as I know, automatic TOC doesn't include an OCR step.

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

No branches or pull requests

3 participants