4051: File fetching cache keys don't take Git's Raw File URL Mask into account


What version are you running?

2.0, 2.5

What steps will reproduce the problem?

  1. Create a Git repository.
  2. Input a bad value for the Raw File URL Mask field.
  3. Attempt to fetch a file (through viewing a diff)
  4. Replace the Raw File URL Mask with a correct value.
  5. 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 in self.raw_file_url.

#1 chipx86
  • -New
  • +Release-2.0.x
  • +EasyFix
#2 kschiu
  • +kschiu
#3 david

Fixed in release-2.5.x (7db43b4). This will ship in 2.5.4.

  • -Confirmed