Skip to content

Commit

Permalink
Take file name into account for file partial caching
Browse files Browse the repository at this point in the history
In certain cases, the md5 and mtime value of a file is the same
for multiple files. Only the file name differs in those cases.
This needs to be considered, in order to have uniq data in the
cache.

In the past this lead to not show certain files in the
webui due to this rails/rails#35145
Since this got fixed, it now does the opposite (showing duplicated entries),
which is more obvious.

Since osc shows the correct files, and missing files are less
obvious than duplicates, this probably took a while to be reported
as an issue.

Fixes openSUSE#9352

Co-authored-by: David Kang <dkang@suse.com>
Co-authored-by: Eduardo Navarro <enavarro@suse.com>
  • Loading branch information
3 people committed Apr 15, 2020
1 parent 64557d3 commit 85c1fda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/views/webui/package/_files_view.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- file_locals = { package: package, project: project, expand: expand, is_current_rev: is_current_rev,
can_modify: user_can_modify_package, nobody: !User.session }
= render partial: 'file', collection: files,
cached: proc { |file| [file[:mtime], file[:md5], file_locals, User.possibly_nobody.in_beta].hash }, locals: file_locals
cached: proc { |file| [file[:name], file[:mtime], file[:md5], file_locals, User.possibly_nobody.in_beta].hash }, locals: file_locals
- else
%i This package has no files yet
- if user_can_modify_package
Expand Down

0 comments on commit 85c1fda

Please sign in to comment.