Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): hasMutedWord for facets with multiple features #2570

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

sugyan
Copy link
Contributor

@sugyan sugyan commented Jun 10, 2024

The hasMutedWord function used in moderation uses the value of the tag in the facets passed as an argument as tags for judging. The current implementation was to “add the 0th of the features to the tags if a feature corresponding to isTag is found”.

This is incorrect, features is an array that can contain multiple elements, and those of type #tag can be included after the first. The 0th element can be hidden by a tag that is not the target word of the mute, or it can be a completely unrelated type.

Actually, it is possible to create such a post (e.g. https://bsky.app/profile/sugyan.pds.shigepon.net/post/3kukmykhshk2l), and an error will occur if a user with mutedWords set tries to view it.

Fixed it so all #tag types in features are subject to the decision, and added a test.

@sugyan sugyan changed the title Fix hasMutedWord for facets with multiple features fix(api): hasMutedWord for facets with multiple features Jun 11, 2024
sugyan added a commit to sugyan/atrium that referenced this pull request Jun 19, 2024
sugyan added a commit to sugyan/atrium that referenced this pull request Jun 19, 2024
* Add moderation methods

* Add extra_data...

* Add Object<T> for object types

* Fix README

* Fix tests

* Remove unnecessary clone() and into()

* Fix ModerationPrefs deserializer

* Fix has_muted_word

bluesky-social/atproto#2570

* Add ThreadViewPreference
Copy link
Collaborator

@pfrazee pfrazee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice yep LGTM

@pfrazee pfrazee merged commit 12dcdb6 into bluesky-social:main Jul 19, 2024
@github-actions github-actions bot mentioned this pull request Jul 19, 2024
estrattonbailey added a commit that referenced this pull request Jul 26, 2024
…cements

* origin/main:
  Use default Statsig export (#2660)
  remove link to invite code form (#2655)
  Version packages (#2652)
  Priority notification setting (#2648)
  fix(api): `hasMutedWord` for facets with multiple features (#2570)
  Appview: enable insight into full thread context (#2651)
  🐛 include takedowns in post thread for admins (#2642)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants