Skip to content

FF: Document finder reads directory randomly #486

@oyeaussie

Description

@oyeaussie

findDocuments method in DocumentFinder.php uses readdir, this function does not sort but instead reads the dir as the files were stored. This is fine if we are looking for multiple files as then we can sort them later. But, if we use findOneBy(), it randomly picks the last modified file, which is not good. We can use scandir instead so we have sorting of files before we run through them.

######## Issue imported from Gitea ########

Details

Gitea Issue ID : 550
State : open
Created : 2024-05-15T21:42:53+10:00

Issue Description

findDocuments method in DocumentFinder.php uses readdir, this function does not sort but instead reads the dir as the files were stored. This is fine if we are looking for multiple files as then we can sort them later. But, if we use findOneBy(), it randomly picks the last modified file, which is not good. We can use scandir instead so we have sorting of files before we run through them.

Timeline

Label : Added P4 on 2024-05-15T21:42:53+10:00.
Label : Added Needs Further Investigation on 2024-05-15T21:42:53+10:00.

Metadata

Metadata

Assignees

Labels

P4To please someone or myself I have opened this issue. Will be fixed before boomers go extinctbugSomething is not working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions