commit 778046f

grunfink  ·  2026-06-24 12:46:28 +0000 UTC
parent f549561
On mismatched 'Update' messages, request the objects instead of just failing.
1 files changed,  +9, -6
+9, -6
 1@@ -3075,9 +3075,11 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
 2                 snac_log(snac, xs_fmt("updated actor %s", actor));
 3             }
 4             else {
 5-                xs_str *e = xs_fmt("Update: mismatched actor '%s' and key '%s'", actor, key_id);
 6-                srv_archive_error("update_actor_key_mismatch", e, req, msg);
 7-                snac_log(snac, e);
 8+                /* actor / key mismatch: don't accept blindly, but request an actor update
 9+                   from the original source, as the Update may come from a relay and be legit */
10+                enqueue_actor_refresh(snac, actor, 0);
11+
12+                snac_log(snac, xs_fmt("Update: mismatched actor '%s' and key '%s'", actor, key_id));
13             }
14         }
15         else
16@@ -3094,9 +3096,10 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
17                     snac_log(snac, xs_fmt("ignored post 'Update' with no attributedTo %s", id));
18                 else
19                 if (strcmp(atto, key_id) != 0) {
20-                    xs_str *e = xs_fmt("Update: mismatched attributedTo '%s' and key '%s'", atto, key_id);
21-                    srv_archive_error("update_post_key_mismatch", e, req, msg);
22-                    snac_log(snac, e);
23+                    /* actor / key mismatch: request the object from the original source */
24+                    enqueue_object_request(snac, id, 0);
25+
26+                    snac_log(snac, xs_fmt("Update: mismatched attributedTo '%s' and key '%s'", atto, key_id));
27                 }
28                 else
29                 if (xs_startswith(id, srv_baseurl) && !xs_startswith(id, actor))