How can I revert split user data resulting from a switch between HTTP and HTTPS communication?
Bug description
I encountered a situation where user data split due to a switch between HTTP and HTTPS communication protocols, and I need to address it safely.
A federated server, initially configured with HTTPS, inadvertently switched to HTTP communication and then returned to HTTPS. Subsequently, user data in the database became split, with accounts having and lacking prefixes. In such cases, post delivery may become irregular depending on previous follow relationships, although I lack detailed insights due to being unable to confirm symptoms across multiple servers.
Example:
ATw2gPkaQEOPHE0pkG.magi@minazukey.uk
Given that these are the same users on the same server, I need a safe method to rectify this state. Unfortunately, on one server, after account data with prefixes was deleted to fix this situation, rendering users on that server unable to follow.
The split of IDs appears to occur under the following conditions:
1.There is a user "alice" on a Pleroma (or Akkoma) server X. There is a user "bob" on a Misskey (or Firefish) server Y. The URL in Y's .config/default.yml is set to HTTPS.
2.At this stage, normal communication is established. At this point, "bob" is known to X (e.g., through follow relationships or boosts). The URL in Y is changed to HTTP.
3.Upon delivery from "bob" to X, a new user ID is assigned internally within X under HTTP settings, while the existing "bob" associated with HTTPS is renamed with an internal ID as a prefix. The URL in Y is changed back to HTTPS.
4.Posts from "bob" are associated with the old ID (with prefix) in X. In this state, there may be irregularities in delivery for new follows or regular posts from previously followed users.
Refreshing follows in state 4 sometimes improves delivery. As the administrator of server Y, I lack access to the internal data of Pleroma servers and face challenges in addressing the same issue across multiple federated servers due to my mistake. Please, I need advice on how to fix it.