fix: clean up replicatedInstances and registry on federation identity deletion
After deleting a federated identity, the server-side user_federation_registry and users.replicated_instances were not cleaned up, causing "already connected" errors when trying to re-federate. The deletion endpoint now authoritatively removes both the registry row and the replicatedInstances entry, and bumps the LWW timestamp to prevent stale client syncs from re-inserting them. Also extends the endpoint to accept mode 'leave' (skip S2S, just clean up), and enables the "Select instances..." scope option in DeleteIdentityDialog.
This commit is contained in:
@@ -704,15 +704,6 @@ export const useInstanceStore = create<InstanceState>((set, get) => ({
|
||||
},
|
||||
|
||||
deleteIdentity: async (origins: string[], mode: 'leave' | 'soft' | 'full' = 'leave') => {
|
||||
// Leave mode: client-only cleanup, no server call
|
||||
if (mode === 'leave') {
|
||||
for (const origin of origins) {
|
||||
get().forceRemoveEntry(origin);
|
||||
}
|
||||
return Object.fromEntries(origins.map(o => [o, { success: true as const }]));
|
||||
}
|
||||
|
||||
// Soft/full mode: S2S relay via home instance
|
||||
try {
|
||||
const { results } = await api.users.deleteFederationIdentity({ origins, mode });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user