# Digging deep into the search tab counters issue (#2174) for #Divine Video
I'm currently investigating and preparing a fix for issue #2174
(search tab counters show wrong values until tab is selected).
In the process, I've mapped out the core problem:
our current shared cache architecture (#NostrEventsDao, #UserProfilesDao) is versatile
but creates interference between features.
Different flows (#search, #feeds, #profiles) write to the same tables,
and when a feature like search relies on that cache for counts, it displays stale or incorrect data.
I've proposed a two-layer approach to @omartinma:
# 1. Immediate Fix:
Stop using the shared cache for search tab counts and rely only on the actual, query-specific search results.
This will solve the user-facing bug right away.
# 2. Architectural Question (The "Why"):
Should we also plan a more robust #cache design?
The goal would be to isolate data contexts so search results don't mix with home feed data,
preventing this class of bugs long-term.
My aim is to not just fix the symptom, but to strengthen the foundation.
I'd love to get your perspective @rabble,
on the long-term vision for our data layer.
Is this the right time to think about a more context-aware caching strategy?
Hoping to get this fix into an upcoming release (maybe Beta 1.0.7? 🚀)
and contribute to making #Divine @Divine HQ more robust with every PR.
#DivineVideo #NostrApp #CleanArchitecture #CacheDesign #AndroidDev #Flutter
GitHub
fix: search tab counters show wrong values until tab is selected · Issue #2174 · divinevideo/divine-mobile
Summary Description On the search screen (Videos / Users / Hashtags), the tab counters show incorrect values right after a search. When a tab is se...