dont set head blob to announce on save

This commit is contained in:
Victor Shyba 2022-02-08 22:10:42 -03:00
parent f271511484
commit 154c41bd8d
2 changed files with 3 additions and 3 deletions

View file

@ -187,8 +187,8 @@ def store_stream(transaction: sqlite3.Connection, sd_blob: 'BlobFile', descripto
).fetchall()
# ensure should_announce is set regardless if insert was ignored
transaction.execute(
"update blob set should_announce=1 where blob_hash in (?, ?)",
(sd_blob.blob_hash, descriptor.blobs[0].blob_hash,)
"update blob set should_announce=1 where blob_hash in (?)",
(sd_blob.blob_hash,)
).fetchall()

View file

@ -97,7 +97,7 @@ class TestReflector(AsyncioTestCase):
async def test_announces(self):
to_announce = await self.storage.get_blobs_to_announce()
self.assertIn(self.stream.sd_hash, to_announce, "sd blob not set to announce")
self.assertIn(self.stream.descriptor.blobs[0].blob_hash, to_announce, "head blob not set to announce")
self.assertNotIn(self.stream.descriptor.blobs[0].blob_hash, to_announce, "head blob set to announce")
async def test_result_from_disconnect_mid_sd_transfer(self):
stop = asyncio.Event()