Cache key that includes a content fingerprint so stale entries are never served * after reload. Unchanged files keep their cache hit across reloads.
(theme: AppTheme, file: DiffFile)
| 80 | /** Cache key that includes a content fingerprint so stale entries are never served |
| 81 | * after reload. Unchanged files keep their cache hit across reloads. */ |
| 82 | function buildCacheKey(theme: AppTheme, file: DiffFile) { |
| 83 | return `${theme.id}:${theme.syntaxTheme ?? theme.appearance}:${file.id}:${patchFingerprint(file)}`; |
| 84 | } |
| 85 | |
| 86 | /** Only commit a highlight result if the promise is still the active one for that key. |
| 87 | * Prevents a superseded or late-resolving promise from overwriting a newer entry. */ |
no test coverage detected