Skip to content

フォロー解除の Undo アクティビティに付与されるidがユニークでない #15464

Closed

Description

@build1024

💡 Summary

フォロー解除 (Undo(Follow)) アクティビティのid属性がユニークなURIでない。同じユーザに対してフォロー・フォロー解除を繰り返すと、2回目以降のフォロー解除のアクティビティに付与されるidの値が、1回目のフォロー解除のidと同じになる。
これにより、連合先のサーバーがid属性を参照して重複除去を行う場合、リモート側で2回目以降のフォロー解除が処理されない場合が生じる。

ActivityPubの勧告 によれば、transientなアクティビティを除いてユニークなidを付与しなければならない、とされているが、transientなアクティビティに対しても、idを付与するからにはユニークなidが付与されるのが望ましいと考える。

🥰 Expected Behavior

フォロー解除ごとにユニークなURIが "id" 属性にセットされる。これにより、フォロー・フォロー解除を繰り返してもリモート側で正しく処理される。

Followアクティビティのidはユニークになっているようなので、例えば
Followのidが https://example.com/follows/a45gal57wrr40006 ならば
Undoのidは https://example.com/follows/a45gal57wrr40006/undo のようになっているとよいと思われる。

🤬 Actual Behavior

フォロー解除のアクティビティに付与されるidがユーザIDのみで構成されたURIであるため、同じユーザから同じユーザにフォロー・フォロー解除を繰り返すとidが重複する。これにより、フォロー解除がリモート側で正しく処理されないケースが生じる。
例: https://example.com/follows/a42euw9b5bi40001/a42j18er5bi4000u/undo

📝 Steps to Reproduce

リモートサーバーがActivityのidを見て重複除去を行う場合(例: Fedify)、リモート側でフォロー解除が処理されないケースを以下の現象で再現できる:

  1. Misskey側のユーザーから、リモートサーバーのActorに対してフォローする。リモート側でアクティビティが処理される。
  2. すぐにフォロー解除する。リモート側でアクティビティが処理される。
  3. 再び同じActorをフォローする。リモート側でアクティビティが処理される。
  4. 再びフォロー解除する。ここで、URIが2.と同一のため、リモート側でアクティビティが処理されない。

💻 Frontend Environment

* Model and OS of the device(s): Windows 11 Home
* Browser: Firefox 135.0
* Server URL: N/A
* Misskey: 2025.2.0

🛰 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?

  • Yes, I will patch the bug myself and send a pull request

Activity

  1. added
    ⚠️bug?
    on Feb 12, 2025
  2. added
    🌌Federation
    on Feb 12, 2025
  3. 1673beta commented on Feb 12, 2025

    @1673beta
    Contributor

    ここでrenderFollowを使ってることに起因してそう

    const content = this.apRendererService.addContext(this.apRendererService.renderUndo(this.apRendererService.renderFollow(follower as MiPartialLocalUser, followee as MiPartialRemoteUser), follower));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚠️bug?🌌Federation

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions