From 85c1fdadc0852ef4e0b348df09d7ea00420240e4 Mon Sep 17 00:00:00 2001 From: Lukas Krause Date: Wed, 15 Apr 2020 18:02:21 +0200 Subject: [PATCH] Take file name into account for file partial caching 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 https://github.com/rails/rails/pull/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 #9352 Co-authored-by: David Kang Co-authored-by: Eduardo Navarro --- src/api/app/views/webui/package/_files_view.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/app/views/webui/package/_files_view.html.haml b/src/api/app/views/webui/package/_files_view.html.haml index 222c2c33365..006a9d797dd 100644 --- a/src/api/app/views/webui/package/_files_view.html.haml +++ b/src/api/app/views/webui/package/_files_view.html.haml @@ -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