Automated enough with selenium to be able to create a Tilde Friends account, create an SSB identity, and post a first message. I'm still confused on some things, but this is progress, and I fixed a longstanding issue creating the first identity.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4377 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-08-03 00:30:48 +00:00
parent 5755b61ea6
commit 16155ef746
10 changed files with 103 additions and 23 deletions

View File

@ -353,16 +353,13 @@ static int _tf_run_task(const tf_run_args_t* args, int index)
}
tf_task_set_db_path(task, db_path);
tf_task_activate(task);
if (args->ssb_port)
if (args->zip)
{
if (args->zip)
{
tf_ssb_import_from_zip(tf_task_get_ssb(task), args->zip, "core", "apps");
}
else
{
tf_ssb_import(tf_task_get_ssb(task), "core", "apps");
}
tf_ssb_import_from_zip(tf_task_get_ssb(task), args->zip, "core", "apps");
}
else
{
tf_ssb_import(tf_task_get_ssb(task), "core", "apps");
}
if (tf_task_execute(task, args->script))
{

View File

@ -239,6 +239,7 @@ typedef struct _tf_ssb_t
void* hitch_user_data;
tf_ssb_store_queue_t store_queue;
int ref_count;
} tf_ssb_t;
typedef struct _tf_ssb_connection_message_request_t
@ -2278,7 +2279,8 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
ssb->broadcast_timer.data ||
ssb->broadcast_cleanup_timer.data ||
ssb->trace_timer.data ||
ssb->server.data)
ssb->server.data ||
ssb->ref_count)
{
uv_run(ssb->loop, UV_RUN_ONCE);
}
@ -2341,7 +2343,11 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
}
if (ssb->loop == &ssb->own_loop)
{
uv_loop_close(ssb->loop);
int r = uv_loop_close(ssb->loop);
if (r != 0)
{
tf_printf("uv_loop_close: %s\n", uv_strerror(r));
}
}
if (ssb->own_context)
{
@ -3568,3 +3574,13 @@ tf_ssb_store_queue_t* tf_ssb_get_store_queue(tf_ssb_t* ssb)
{
return &ssb->store_queue;
}
void tf_ssb_ref(tf_ssb_t* ssb)
{
ssb->ref_count++;
}
void tf_ssb_unref(tf_ssb_t* ssb)
{
ssb->ref_count--;
}

View File

@ -200,3 +200,6 @@ uint64_t tf_ssb_get_average_thread_time(tf_ssb_t* ssb);
void tf_ssb_set_hitch_callback(tf_ssb_t* ssb, void (*callback)(const char* name, uint64_t duration_ns, void* user_data), void* user_data);
tf_ssb_store_queue_t* tf_ssb_get_store_queue(tf_ssb_t* ssb);
void tf_ssb_ref(tf_ssb_t* ssb);
void tf_ssb_unref(tf_ssb_t* ssb);

View File

@ -1209,6 +1209,7 @@ static void _tf_ssb_rpc_delete_blobs_after_work(uv_work_t* work, int status)
{
delete_blobs_work_t* delete = work->data;
tf_ssb_record_thread_time(delete->ssb, (int64_t)delete->thread_id, delete->end_time - delete->start_time);
tf_ssb_unref(delete->ssb);
tf_free(delete);
}
@ -1238,6 +1239,7 @@ static void _tf_ssb_rpc_start_delete_blobs(tf_ssb_t* ssb, int delay_ms)
*timer = (uv_timer_t) { .data = ssb };
uv_timer_init(tf_ssb_get_loop(ssb), timer);
uv_timer_start(timer, _tf_ssb_rpc_start_delete_timer, delay_ms, 0);
tf_ssb_ref(ssb);
}
void tf_ssb_rpc_register(tf_ssb_t* ssb)