fix(cache): use getOrCreateNote for reply linking to fix flaky thread test
Fixes #2001 — ThreadFilter test failed intermittently because consumeTextNote used getNoteIfExists for reply-to linking. If the reply event arrived before the root, the link was lost. Now uses getOrCreateNote to create placeholders, same pattern as reposts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+1
-1
@@ -228,7 +228,7 @@ class DesktopLocalCache : ICacheProvider {
|
||||
val note = getOrCreateNote(event.id)
|
||||
if (note.event != null) return false
|
||||
val author = getOrCreateUser(event.pubKey)
|
||||
val repliesTo = event.tagsWithoutCitations().mapNotNull { getNoteIfExists(it) }
|
||||
val repliesTo = event.tagsWithoutCitations().map { getOrCreateNote(it) }
|
||||
note.loadEvent(event, author, repliesTo)
|
||||
relay?.let { note.addRelay(it) }
|
||||
repliesTo.forEach { it.addReply(note) }
|
||||
|
||||
Reference in New Issue
Block a user