8000 ❇️ Ozone user agent by foysalit · Pull Request #3991 · bluesky-social/atproto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

❇️ Ozone user agent #3991

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

❇️ Ozone user agent #3991

wants to merge 3 commits into from

Conversation

foysalit
Copy link
Contributor

This PR adds an optional userAgent property to moderation events, allowing for better tracing of where events are coming from. The primary property of the userAgent object is just a name string while it allows for any additional metadata passing via the extra object.

@foysalit foysalit requested a review from devinivy June 23, 2025 19:30
"type": "string",
"description": "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')"
},
"extra": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

extra works for me, though I also wonder if something more neutral about the info's "extra-ness" like details could also be good.

Comment on lines +905 to +908
"name": {
"type": "string",
"description": "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume also using an actual user-agent string (in this sense) would also be welcome.

Comment on lines +56 to +59
"userAgent": {
"type": "ref",
"ref": "tools.ozone.moderation.defs#userAgent"
}
8000
Copy link
Collaborator

Choose a reason for hiding this comment

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

My only confusion about this kind of usage is that there is also the user-agent header which will be present in these requests.

@@ -1,5 +1,6 @@
import {
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be worth a changeset for this dev-env change.

userAgent: row.userAgent
? {
name: row.userAgent.name,
extra: row.userAgent.extra as { [x: string]: unknown } | undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this cast be addressed by updating the type in the moderation_event schema?

Comment on lines +9 to +13
await db.schema
.createIndex('moderation_event_user_agent_name_idx')
.on('moderation_event')
.expression(sql`("userAgent" ->> 'name')`)
.execute()
Copy link
Collaborator
@devinivy devinivy Jun 24, 2025

Choose a reason for hiding this comment

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

If many events end-up being created by the same system, with the same user agent name, even this index may not save us! Do we think that is likely? What is the most similar use case in queryEvents (where I assume this index is used) and how is it indexed?

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
0