fix slow first message

This commit is contained in:
Christien Rioux 2024-06-10 10:04:03 -04:00
parent 6c4b803091
commit b0d4e35c6f
9 changed files with 141 additions and 5 deletions

View file

@ -71,6 +71,12 @@ class _DHTLogSpine {
// Write new spine head record to the network
await spine.operate((spine) async {
// Write first empty subkey
final subkeyData = _makeEmptySubkey();
final existingSubkeyData =
await spineRecord.tryWriteBytes(subkeyData, subkey: 1);
assert(existingSubkeyData == null, 'Should never conflict on create');
final success = await spine.writeSpineHead();
assert(success, 'false return should never happen on create');
});