mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 16:57:39 +00:00
Review findings from @davotoula:
1. Behaviour drift (real): the per-note event finder reused Account.searchRelays()
(trusted + own search list), widening every missing-event REQ to trusted relays.
Add a narrow UserFinderAccount.searchOnlyRelays() (= the pre-extraction
account.searchRelayList read) and use it in FilterMissingEvents. Implemented on
Account and DesktopIAccount.
2. Runtime trap: LocalUserFinder/LocalUserFinderAccount/LocalEventFinder error() when
unprovided and were only provided on Desktop. Provide them on Android too, at the
logged-in root (AppNavigation) from accountViewModel.dataSources() + .account, so any
shared composable using the no-arg observeUser*/EventFinderFilterAssemblerSubscription
overloads is safe on Android (the :napplet process never renders these).
3. Removed the redundant `.ifEmpty { DefaultSearchRelayList }` in Account.searchRelays()
(SearchRelayListState.flow already applies that fallback) + its now-unused import.
4. Fixed a pre-existing shadowing bug on lines this PR touches: FilterByEvent's
`note.replyTo?.forEach { parentNote -> }` used `note` in the body, so parent notes were
never fetched — now uses `parentNote`.
5. Added a test at the layer where #1 lived: filterMissingEvents(cache, keys) fans a
missing event to searchOnlyRelays + the follow/mine/search default, NOT the trusted
relays that searchRelays would add.
6. Replaced an inline fully-qualified name in the test with an import (CLAUDE.md style).
Green: commons jvmTest + verifyKmpPurity, :amethyst compilePlayDebugKotlin, :desktopApp compile, spotless.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>