AudiusProject / audius-protocol

The Audius Protocol - Freedom to share, monetize, and listen to any audio content.
https://docs.audius.org
Other
552 stars 106 forks source link

[C-5066 C-5023] Refactor pinned comment, fix unpin #9953

Open dylanjeffers opened 1 day ago

dylanjeffers commented 1 day ago

Description

Fixes issue where pinning a new comment wasn't unpinning the existing comment. This is done by refactoring how pinned comments are modeled, by removing "is_pinned" on individual comments, and instead adding "pinned_comment_id" to teh track. In a lot of ways this makes more sense: it's more similar to how artist_pick works, it prevents track owner from modifying someone else's comment data, and avoids a ton of pitfalls and subtle bugs managing pinned comments in entity_manager.

One slightly awkward aspect of this is that we have to pass the track_id, ie entity_id as metadata through. This is actually nice though because now we can validate that the user attempting to pin the comment is the actual owner of the track, which solves an outstanding bug.

changeset-bot[bot] commented 1 day ago

⚠️ No Changeset found

Latest commit: 9d21f0706372893982ac1ba736f36d76a4668151

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR