Skip to content

fix: update stale previews when preload is enabled - #2567

Merged
joelim-work merged 1 commit into
gokcehan:masterfrom
valoq:cache-fix
May 4, 2026
Merged

fix: update stale previews when preload is enabled#2567
joelim-work merged 1 commit into
gokcehan:masterfrom
valoq:cache-fix

Conversation

@valoq

@valoq valoq commented May 2, 2026

Copy link
Copy Markdown
Contributor

checkReg detects external file modifications by comparing mtime to reg.loadTime, but pushes the resulting reload to previewChan. When using the preload option, the deferred regChan send in preview() checks if gOpts.preload + "preload" and silently drops the result, leaving the cache stale forever.

This fix now matches the other cases and refreshes the cached preview data when a file changed

@joelim-work joelim-work added the fix Pull requests that fix existing behavior label May 4, 2026
@joelim-work joelim-work added this to the r42 milestone May 4, 2026

@joelim-work joelim-work left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the bug fix.

This was an oversight by me, but yes when preload is enabled preloadChan should be used instead of previewChan when loading an image preview into the cache.

@joelim-work joelim-work changed the title fix: invalidate stale preview cache under preload fix: update stale previews when preload is enabled May 4, 2026
@joelim-work
joelim-work merged commit ac8f594 into gokcehan:master May 4, 2026
32 checks passed
joelim-work added a commit that referenced this pull request May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants