fix: replace eventCache LruCache with ConcurrentHashMap#307
Merged
Conversation
…iction bugs LruCache(15000) was silently evicting events under pressure, causing orphaned notes in threads, broken quote embeds, and empty thread views on tap. Replace with ConcurrentHashMap (no eviction cap) and add an ObjectBox fallback in getEvent() for cross-session lookups. Also remove two oversized vector drawables (130KB+ pathData strings) that caused AAPT2 STRING_TOO_LARGE build failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eventCache: LruCache<String, NostrEvent>(15000)withConcurrentHashMap<String, NostrEvent>()to eliminate silent eviction of eventsgetEvent()so cross-session lookups resolve from the database when not in memoryimage2vector.xml,ic_launcher_foreground.xml) with 130KB+ path data strings that caused AAPT2STRING_TOO_LARGEbuild failures; switch splash screen icon tosplash_icon.xmlWhy
LruCache(15000)evicted events under session pressure. Any code callinggetEvent(id)after eviction got null — causing orphaned notes in thread view, blank quote embeds, and empty thread views on tap. The events existed in ObjectBox but the cache never fell back to query them.ConcurrentHashMaphas no eviction cap so events stay available for the session lifetime. Memory scales with actual usage (~2k–10k events typical) rather than a fixed 15k ceiling.clearAll()/clearFeed()still wipe it on logout or feed switch.Test plan
STRING_TOO_LARGEerrors