-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add feature flag for fake marking results as sensitive #862
Conversation
Full-stack documentation: Ready https://WordPress.github.io/openverse/_preview/862 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach works perfectly. Awesome. Do you think it's worth creating a little utility function for the mature detection so the logic doesn't need to be updated in two places? Something like:
const fakeMature = (item) => {
if (prng(hash(item.id))() < 0.5) return
item.mature = true
log("Fake mature", item.id)
}
I don't think it's necessary but something to consider.
I also tried this with some blurring, which was a fun way to test:
Good point, I'll extract it to a separate utility 👍. Update: done in b57157d. |
@@ -44,6 +44,8 @@ export interface Media { | |||
|
|||
tags: Tag[] | |||
fields_matched?: string[] | |||
|
|||
mature: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I didn't know we didn't have this in the type! Great catch! Is it always available, or should we mark it as optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice! I have a question about mature
type inline, but don't want to block the PR.
Fixes
Fixes #854 by @zackkrida
Description
This PR adds a feature flag
fake_sensitive
to mark roughly half the results as mature. It uses a random (but deterministic) approach which allows results to be marked mature consistently and across Pinia stores and browsing sessions.This PR makes no UI changes. It is limited in scope to just adding the feature flag and setting up its behaviour. UI changes are already necessitated by #791 so this PR does not put in effort that's destined to be repeated.
Testing Instructions
/preferences
.Fake mature <uuid4>
for ~50% of results.Fake mature <uuid4>
log again because it also works on the single media store.Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin