misskey-dev / misskey

🌎 An interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.82k stars 1.32k forks source link

preferredUsernameが無いActorに紐づくリモートユーザーを照会できない #14106

Open PichuChen opened 2 months ago

PichuChen commented 2 months ago

💡 Summary

タイトル通りです。 As Title.

Test case:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "endpoints": {
    "sharedInbox": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/inbox"
  },
  "followers": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice/followers",
  "following": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice/following",
  "id": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice",
  "inbox": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice/inbox",
  "liked": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice/liked",
  "outbox": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice/outbox",
  "streams": "https://c8a0-150-117-165-81.ngrok-free.app/.activitypub/actor/alice/streams",
  "type": "Person"
}

As the Activity Pub standard:

Implementations MAY provide the following properties:
... 

preferredUsername
A short username which may be used to refer to the actor, with no uniqueness guarantees.

image https://www.w3.org/TR/activitypub/#actor-objects

so some Instance may not have this field.

13735 と似ています。

🥰 Expected Behavior

更新できる

🤬 Actual Behavior

ERR  *  [api]   Internal error occurred in federation/update-remote-user: invalid Actor: wrong username {
  ep: 'federation/update-remote-user',
  ps: { userId: '9v5d9uxbo4rt0001', i: 'YRFTdJxjTiwhC35Z' },
  e: {
    message: 'invalid Actor: wrong username',
    code: 'Error',
    stack: 'Error: invalid Actor: wrong username\n' +
      '    at ApPersonService.validateActor (file:///workspace/packages/backend/built/core/activitypub/models/ApPersonService.js:120:19)\n' +
      '    at ApPersonService.updatePerson (file:///workspace/packages/backend/built/core/activitypub/models/ApPersonService.js:369:29)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async file:///workspace/packages/backend/built/server/api/endpoints/federation/update-remote-user.js:41:13\n' +
      '    at async ApiCallService.call (file:///workspace/packages/backend/built/server/api/ApiCallService.js:382:20)',
    id: 'd6c620b5-41af-4b19-95b5-ee58a25d61b2'
  }
}

📝 Steps to Reproduce

No response

💻 Frontend Environment

* Model and OS of the device(s):
* Browser:
* Server URL:
* Misskey:

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service:
* Misskey:
* Node:
* PostgreSQL:
* Redis:
* OS and Architecture:

Do you want to address this bug yourself?

tesaguri commented 1 month ago

Related discussions: