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

ModerationQueryStatuses always return nil and missing onlyMuted param #699

Open
xtianpu opened this issue Jul 5, 2024 · 1 comment
Open

Comments

@xtianpu
Copy link

xtianpu commented Jul 5, 2024

ModerationQueryStatuses always return nil for all reviewState and missing onlyMuted param (here)

I have tested by manual call to https://agaric.us-west.host.bsky.network/xrpc/tools.ozone.moderation.queryStatuses?limit=50&includeMuted=true&sortField=lastReportedAt&sortDirection=desc and responded as expected.

@xtianpu xtianpu changed the title tools.ozone.moderation.queryStatuses always return nil for all reviewState and missing onlyMuted param ModerationQueryStatuses always return nil and missing onlyMuted param Jul 9, 2024
@xtianpu
Copy link
Author

xtianpu commented Jul 13, 2024

Hi @bnewbold, thank you for adding onlyMuted param.

Anyway, I have found why ModerationQueryStatuses always return nil, looks like because Appealed type is bool and forced me to use true and false value only which resulting the PDS always returning nil since there is no True or False Appealed records but nil.

I have tested using this params, and it worked as expected by providing empty string to "appealed" map key as below:

params := map[string]interface{}{
		"appealed":       "",
		"comment":        "",
		"cursor":         "",
		"includeMuted":   true,
		"lastReviewedBy": "",
		"limit":          50,
		"onlyMuted":      false,
		"reportedAfter":  "",
		"reportedBefore": "",
		"reviewState":    "tools.ozone.moderation.defs#reviewOpen",
		"reviewedAfter":  "",
		"reviewedBefore": "",
		"sortDirection":  "desc",
		"sortField":      "lastReportedAt",
		"subject":        "",
		"takendown":      false,
}

Response of request by using above params as below:

&ozone.ModerationDefs_SubjectStatusView{
            Appealed:           (*bool)(nil),
            Comment:            (*string)(nil),
            CreatedAt:          "2024-07-13T17:08:18.950Z",
            Id:                 16623,
            LastAppealedAt:     (*string)(nil),
            LastReportedAt:     &"2024-07-13T17:08:18.945Z",
            LastReviewedAt:     (*string)(nil),
            LastReviewedBy:     (*string)(nil),
            MuteReportingUntil: (*string)(nil),
            MuteUntil:          (*string)(nil),
            ReviewState:        &"tools.ozone.moderation.defs#reviewOpen",
            Subject:            &ozone.ModerationDefs_SubjectStatusView_Subject{
                AdminDefs_RepoRef: &atproto.AdminDefs_RepoRef{LexiconTypeID:"com.atproto.admin.defs#repoRef", Did:"did:plc:xxxxxxxxxxxxxxxxxxx"},
                RepoStrongRef:     (*atproto.RepoStrongRef)(nil),
            },
            SubjectBlobCids:   {},
            SubjectRepoHandle: &"zxzxzx.bsky.social",
            SuspendUntil:      (*string)(nil),
            Tags:              {"lang:in"},
            Takendown:         &bool(false),
            UpdatedAt:         "2024-07-13T17:08:19.531Z",
        },

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

No branches or pull requests

1 participant