mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
DesktopLocalCache stores Users in a WeakReference-backed LargeSoftCache. The followee User in kind3IsHydratedBeforeKind0SoMetadataLoadsForFollowedAuthors is created only during hydrate's kind:0 phase and has no Note referencing it, so it is only weakly reachable once hydrate returns. A GC landing between hydrate() and the assertions evicted it, flaking the test (reproduced deterministically by forcing System.gc()). Pin a strong reference to the followee's User for the duration of the test so the cache cannot evict it, mirroring how followed users stay reachable via live account/UI state in the running app. The ordering invariant the test asserts is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NHQ3g7wD9WbDvj7NspiAWW