Skip to content

Conversation

alltheseas
Copy link
Collaborator

Summary

fixes kingcache media/image cache clearing bug

image

Checklist

  • I have read (or I am familiar with) the Contribution Guidelines
  • I have tested the changes in this PR - *only in Xcode iOS Simulator
  • I have profiled the changes to ensure there are no performance regressions, or I do not need to profile the changes.
  • I have opened or referred to an existing github issue related to this change: Double-check why kingfisher isn't clearing #2861
  • My PR is either small, or I have split it into smaller logical commits that are easier to review
  • I have added the signoff line to all my commits. See Signing off your work
  • I have added appropriate changelog entries for the changes in this PR. See Adding changelog entries
    • I do not need to add a changelog entry. Reason: [Please provide a reason]
  • I have added appropriate Closes: or Fixes: tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patches

Test report

Tested in Xcode iOS Simulator & MacOS working directory terminal.

If you want to capture logs yourself, run this in a terminal window before pressing the button:

  log stream --level info --style compact --predicate 'subsystem == "com.jb55.damus" && category == "storage"'

  Keep the command running and tap Clear Cache in the simulator; those messages will stream by. That confirms Kingfisher and the cache directory both get cleared.

Device: 17 Pro iOS Simulator

iOS: iOS 26

Damus: 1.15 (1) 8122a8a

Steps: run terminal log stream command above, disable image blur, go to universe view, scroll for 30 seconds to accumulate sufficient media for kingfisher. go to settings -> appearance -> clear cache, verify in terminal

Results:

  • [] PASS
  • Partial PASS
    • Details: needs on phone confirmation/verificaiton (was not able to compile to my phone)

Other notes

~1 minute of scrolling without blur in universe view generated over 200 MB of kingfisher cache size!

@alltheseas alltheseas added bug Something is not working, or not working as intended media labels Oct 17, 2025
@danieldaquino
Copy link
Collaborator

@alltheseas, unfortunately it does not seem like this fixes the main issue. That part of the cache clearing seems to have been working prior to the PR.

I locally downloaded the changes and removed all functional changes — leaving only the new logging code, and reran the test. The results were the same as posted.

Device: iPhone simulator
iOS: iOS 26
Damus: 138f0f2 (Includes only the logs but no functional changes)
Steps:

  1. Scroll through the timeline
  2. Run log stream --level info --style compact --predicate 'subsystem == "com.jb55.damus" && category == "storage"' to get logs
  3. Clear cache in settings

Results: Cache appears to clear; Logs have the same pattern as the PR description
Screenshot 2025-10-17 at 16 13 30

I believe the main issue of #2861 is in a different place and more investigation would be needed to find out where it is and reproduce it.

@jb55, any other thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working, or not working as intended media

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants