Trying to understand a lingering 'previous message doesn't exist.' And format.

This commit is contained in:
2024-05-08 12:20:57 -04:00
parent c7ab5447ea
commit c0e72246cc
2 changed files with 10 additions and 13 deletions

View File

@ -347,7 +347,7 @@ static int64_t _tf_ssb_db_store_message_raw(tf_ssb_t* ssb, const char* id, const
}
else
{
tf_printf("%p: Previous message doesn't exist for author=%s sequence=%" PRId64 ".\n", db, author, sequence);
tf_printf("%p: Previous message doesn't exist for author=%s sequence=%" PRId64 " previous=%s.\n", db, author, sequence, previous);
}
tf_ssb_release_db_writer(ssb, db);
return last_row_id;
@ -1742,10 +1742,8 @@ bool tf_ssb_db_identity_get_active(sqlite3* db, const char* user, const char* pa
bool found = false;
if (sqlite3_prepare(db, "SELECT value FROM properties WHERE id = ? AND key = 'id:' || ? || ':' || ?", -1, &statement, NULL) == SQLITE_OK)
{
if (sqlite3_bind_text(statement, 1, user, -1, NULL) == SQLITE_OK &&
sqlite3_bind_text(statement, 2, package_owner, -1, NULL) == SQLITE_OK &&
sqlite3_bind_text(statement, 3, package_name, -1, NULL) == SQLITE_OK &&
sqlite3_step(statement) == SQLITE_ROW)
if (sqlite3_bind_text(statement, 1, user, -1, NULL) == SQLITE_OK && sqlite3_bind_text(statement, 2, package_owner, -1, NULL) == SQLITE_OK &&
sqlite3_bind_text(statement, 3, package_name, -1, NULL) == SQLITE_OK && sqlite3_step(statement) == SQLITE_ROW)
{
snprintf(out_identity, out_identity_size, "%s", (const char*)sqlite3_column_text(statement, 0));
found = true;
@ -1830,8 +1828,7 @@ static void _tf_ssb_db_resolve_index_after_work(uv_work_t* work, int status)
void tf_ssb_db_resolve_index_async(tf_ssb_t* ssb, const char* host, void (*callback)(const char* path, void* user_data), void* user_data)
{
resolve_index_t* request = tf_malloc(sizeof(resolve_index_t));
*request = (resolve_index_t)
{
*request = (resolve_index_t) {
.work = { .data = request },
.ssb = ssb,
.host = tf_strdup(host),