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

Handle sync legacy labels #2291

Merged
merged 4 commits into from
Mar 11, 2024
Merged

Conversation

estrattonbailey
Copy link
Member

@estrattonbailey estrattonbailey commented Mar 11, 2024

During this transition to new label names, some clients may not update immediately. This PR ensures basic backwards compat for global label settings only between old/new clients.

Old clients of course behave the same. Updated clients with this new SDK (once published) will double-write new labels to old labels in an effort to keep them in sync. So changes to new label settings will be reflected in the old clients.

If a user edits a setting in an older client (without the double-write), and subsequently loads their account in an updated client, this PR remaps old values to new values. This will result in the updated client showing the correct values in label settings. If the user then updates label settings in the updated, client, the double write will take effect, and the old setting will in turn be updated. Subsequent reloads of the updated client will remap old to new, but the values will be the same.

@pfrazee pfrazee marked this pull request as ready for review March 11, 2024 23:18
@pfrazee pfrazee merged commit 6583125 into additional-3p-labeler-updates Mar 11, 2024
1 of 10 checks passed
@pfrazee pfrazee deleted the sync-legacy-labels branch March 11, 2024 23:18
pfrazee pushed a commit that referenced this pull request Mar 12, 2024
* Handle sync legacy labels

* Remap values on read

* Filter out double-written legacy label values

* Better naming, fix types
pfrazee pushed a commit that referenced this pull request Mar 13, 2024
* Handle sync legacy labels

* Remap values on read

* Filter out double-written legacy label values

* Better naming, fix types
pfrazee added a commit that referenced this pull request Mar 13, 2024
* Rename bsky_labeler_did

* Use labeldef default setting

* Add definedBy to interpretted label defs

* Improve dev-env mocks for labels

* Remove global label defs for dmca-violation, doxxing, and !no-promote

* Change nudity global label def to default to ignore and no longer be adult-only

* Remove old !no-promote tests

* Add mod authorities header and move bsky labeler into it

* Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler

* Add defaultSetting and adultOnly to custom label value definitions

* Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition

* Update dev-env mock

* Move muted words and hidden posts into moderationPrefs

* Add muted word and hidden post handling to moderatePost

* Add mutewords tests

* Finish muteword tests

* Add mod-authority.test to dev-env

* Rename global label value def gore to graphic-media

* Fix typo

* Stop converting old label values

* Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards

* Update label target=account behaviors: dont blur media of content

* Add muteword moderation behaviors

* Fix mock label defs

* Implement quote-post moderation handling

* Add adult content test

* Handle sync legacy labels (#2291)

* Handle sync legacy labels

* Remap values on read

* Filter out double-written legacy label values

* Better naming, fix types

* Fix test

* Update moderation docs in sdk

* Update to new atproto-accept-labelers header behavior

* Add getLabelDefinitions() helper method

* Add proxy header support to agent

* Update mock moderation

* lint

* Implement moderation for userlists and feedgens

* Add another test label

* fix labeler in dev-env agents

* fix label hydration test

* fix lint error

* fix agent test

* fix takedown labels test

---------

Co-authored-by: Eric Bailey <[email protected]>
Co-authored-by: dholms <[email protected]>
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