4051: File fetching cache keys don't take Git's Raw File URL Mask into account
- Fixed
- Review Board
chipx86 | |
kschiu |
What version are you running?
2.0, 2.5
What steps will reproduce the problem?
- Create a Git repository.
- Input a bad value for the Raw File URL Mask field.
- Attempt to fetch a file (through viewing a diff)
- Replace the Raw File URL Mask with a correct value.
- Attempt to fetch the file again.
What is the expected output? What do you see instead?
With the bad value, it should show an error in the diff viewer, but after correcting it, it should properly load the diff.
Instead, it's caching the broken page, since it doesn't know that the Raw File URL Mask has changed.
What we should be doing is factoring in that value into the cache key, if set, ensuring that we have different cache keys for different values.
This would be done in
reviewboard/scmtools/models.py
, in_make_file_cache_key
and_make_file_exists_cache_key
. Those keys should factor inself.raw_file_url
.