1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00
damus/nostrdb
Daniel D’Aquino a06be64894 network: Broadcast quoted notes when posting a note with quotes
This change addresses an issue where notes with quotes sometimes are not loaded correctly because the quoted note was not available in the same relay. Now whenever a user posts a note with a quoted note, the quoted note is also broadcast to the user's selected relays.

Issue repro
-----------

ISSUE REPRODUCED

Device: iPhone 14 Pro Simulator
iOS: 17.0
Damus: `1fabd4c0fe98d1f47b1fa0f76984ad78095bd49c`
Setup:
- Make sure you have a debugger connected
- Have a test note that you can quote

Steps:

1. Start Damus and let logs settle
2. Observe where the last log is
3. Quote the test note
4. Copy newly generated logs and paste on a text editor.
5. Analyze those logs. Pay attention to the new note id, as well as the note id of the quoted event (`["q", <QUOTED_NOTE_ID>]`)

Results: Logs show that the newly posted event is being flushed to the relays, but not the note that is being quoted.

Testing of the fix
------------------

PASS

Device: iPhone 14 Pro Simulator
iOS: 17.0
Damus: This commit
Setup:
- Make sure you have a debugger connected
- Have a test note that you can quote

Steps:

1. Start Damus and let logs settle
2. Observe where the last log is
3. Quote the test note
4. Copy newly generated logs and paste on a text editor.
5. Analyze those logs. Pay attention to the new note id, as well as the note id of the quoted event (`["q", <QUOTED_NOTE_ID>]`)

Results:
- Logs show the new event being flushed to the relays. PASS
- Logs show the quoted event also being flushed to the relays. PASS

Closes: https://github.com/damus-io/damus/issues/1495
Changelog-Fixed: Broadcast quoted notes when posting a note with quotes
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-07 14:49:53 -07:00
..
bindings flatbuffers: update bindings, add verifier 2023-08-28 08:17:25 -07:00
flatcc flatbuffers: update bindings, add verifier 2023-08-28 08:17:25 -07:00
Test tests: add ndb support to tests 2023-09-21 09:10:06 -04:00
AsciiCharacter.swift ndb: make AsciiCharacter a CustomStringConvertible 2023-08-01 21:53:19 -07:00
copy-ndb ndb: remove patch from copy script, just use sed 2023-08-28 08:18:25 -07:00
jsmn.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
lmdb.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
mdb.c nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
memchr.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
midl.c nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
midl.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
Ndb.swift ndb: add process_client_event helper 2023-09-24 17:06:35 -07:00
NdbNote.swift network: Broadcast quoted notes when posting a note with quotes 2023-10-07 14:49:53 -07:00
NdbTagElem.swift ndb: switch to nostrdb notes 2023-08-03 13:20:36 -07:00
NdbTagIterator.swift ndb: sync up a few remaining NdbNote tag differences 2023-07-25 16:22:25 -07:00
NdbTagsIterator.swift ndb: switch profile queries to use transactions 2023-09-21 09:10:06 -04:00
NdbTxn.swift ndb: switch profile queries to use transactions 2023-09-21 09:10:06 -04:00
nostrdb.c Fix profiles not updating 2023-10-06 10:42:17 -07:00
nostrdb.h nostrdb: add last fetched records for profiles 2023-10-06 10:42:17 -07:00
protected_queue.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
random.h ndb: make NostrEvents immutable 2023-07-25 15:34:05 -07:00
secp256k1_ecdh.h ndb: make NostrEvents immutable 2023-07-25 15:34:05 -07:00
secp256k1_extrakeys.h ndb: make NostrEvents immutable 2023-07-25 15:34:05 -07:00
secp256k1_schnorrsig.h ndb: make NostrEvents immutable 2023-07-25 15:34:05 -07:00
secp256k1.h ndb: make NostrEvents immutable 2023-07-25 15:34:05 -07:00
threadpool.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
util.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00