mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(federation): 🐛 Update user processing to not refetch user when its data is already available
This commit is contained in:
parent
c9a1581932
commit
757c227f00
|
|
@ -555,16 +555,17 @@ export class InboxProcessor {
|
|||
*/
|
||||
private async processUserRequest(): Promise<Response | null> {
|
||||
const user = this.body as unknown as VersiaUser;
|
||||
// FIXME: Instead of refetching the remote user, we should read the incoming json and update from that
|
||||
const updatedAccount = await User.fetchFromRemote(new URL(user.uri));
|
||||
const instance = await Instance.resolve(new URL(user.uri));
|
||||
|
||||
if (!updatedAccount) {
|
||||
if (!instance) {
|
||||
return Response.json(
|
||||
{ error: "Failed to update user" },
|
||||
{ status: 500 },
|
||||
{ error: "Instance not found" },
|
||||
{ status: 404 },
|
||||
);
|
||||
}
|
||||
|
||||
await User.fromVersia(user, instance);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue