~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Moderators see what the group took down, where they review it

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:moderation/takedown-review

What changes

Moderators see what was taken down, where they review it. A !takedown label still hides a record and its files from listSpaceRecords and getSpaceBlob for everyone, moderators included. Now getModSubjectHistory also answers, for a subject that's a record in one of the group's spaces, the record as the host's index holds it (defs#modRecordView: uri, cid, value, createdAt, takenDown), and the new fyi.opensocial.getModSubjectBlob serves the files that record holds, by CID, read from whoever wrote it. Both need mod.read, and both give the record only to a caller whom the space's policy lets read it. authModerate and authManageGroup list the new method, and a group session keeps it where its roles hold mod.read.

The console's Review shows the post. A record subject's Review opens with What was posted: its text fields (times last, said as the console says times), its pictures (through getModSubjectBlob), and the record as posted, folded, in a well that scrolls sideways. Taken down, it carries a Taken down tag and a line saying only moderators see it there (ReviewedRecord.svelte).

An act on the Escalated or Resolved tab stays there. Since Kit 3, use:enhance navigates to where a form posted unless told not to, so labelling or taking down from ?status=escalated threw the page back to Open with the dialog closed. #lib/forms.ts's in-place helpers now pass navigate: false; redirects are still followed.

/img honours takedowns. The console's pictures at /img/{did}/{cid} no longer serve a file a takedown of the group's takes out of a space, to anyone, as getSpaceBlob doesn't; a moderator reads it through getModSubjectBlob. An image in a public repo is still served as before.

Docs. design/moderation.md has a part on reviewing what was taken down; reference/api.md lists the method and the new field; design/signing-in.md the method a session keeps; the moderating guide has a part on taking a post down, with its picture. The moderating seed's reported post is now a real post of frank's with a picture, and the report names its version.

Why

A takedown hid the content from everyone, so a moderator reviewing a report or an appeal saw the history but not what it was about. The narrowest fix is in the moderation path itself: the reads anyone (and any app a moderator uses) makes of a space still leave it out, and only the queue's own methods show it, to mod.read holders the space lets read it, so the queue never shows anyone more than the space would if the takedown were lifted.

How it was checked

  • shows_a_moderator_what_was_taken_down_where_they_review_it (tests/moderation.rs): a plain member and the moderator alike don't get the taken-down record or its file through listSpaceRecords or getSpaceBlob; the moderator gets the record, takenDown: true, and its file through getModSubjectHistory and getModSubjectBlob; a record left up comes with takenDown: false; a file the record doesn't hold, an account, a record the index lacks, a public record and an unhosted space give none; a plain member gets Forbidden; a moderator the space doesn't let read gets the history without the record. Run locally; the rest is left to the test check.
  • just lex, just fmt, node harness/layers.mjs, dialogs.mjs, strings.mjs and npm run check in web/, locally.
  • Looked at with just look (the Review of frank's post before and after a takedown, the whole record open; desktop and phone, light and dark); the moderating guide's pictures drawn again with just shots.

Shortcomings

  • An account's subject carries no record: what a taken-down account wrote shows only record by record, each reviewed as its own subject.
  • The record shown is the version the index holds now, which can be newer than the one a report names.
  • origin/appeals is older than the proposal catch-up; nothing here touches what it changes, but it will need to merge main.

Review

Start at takedown.rs (Host::reviewed), then the two handlers at the end of the queue's in moderation.rs.

Approved

This adds a record to getModSubjectHistory and a new getModSubjectBlob, so moderators can see a taken-down record and its files. The console's Review shows them, and the in-place forms no longer navigate.

I read the Rust path closely: Host::reviewed, both handlers, and the subject_of/space_of checks. I did not read the web, docs, seed, lexicon JSON or test diffs.

  • Group check: subject_of requires the record's space authority to be this group, so a moderator of one group can't read another group's space through this route.
  • Read check: reviewed also requires may(.., Access::Read), so the queue never shows more than the space would if the takedown were lifted.
  • Blob check: getModSubjectBlob serves only a CID the record itself holds (blob_refs), through the same served headers as getSpaceBlob (nosniff, private cache).
  • Parsing: the subject[space.len() + 1..] slice and the expect on split_once are safe because space_of has already validated the URI's shape.
  • Hosting: reviewed returns nothing for an unhosted space.

Nothing needs to change before merge. The 100% line gate and the web, e2e and docs checks are left to CI, as the body says.

Approved

Since my approval at 4eb1551, the pull has one new commit of its own, plus a merge of main. The commit makes the console's /img/{did}/{cid} honour takedowns, as getSpaceBlob does. I read that diff in blobs.rs, the new test lines and the docs lines. I did not read the merged-in main changes, which aren't this pull's.

  • may_see: for each space holding the file, it now needs the caller to be allowed to read the space and the file not to be taken down there. The expect after the transpose is safe, because the continue has already filtered out an unhosted space. A file that is up in one space but taken down in another is still served through the first, which is the right behaviour.
  • Moderators: they get no /img exception, and read the file through getModSubjectBlob instead, as the body says.
  • Test: it asserts 404 on the taken-down map and 200 on the flyer that nothing taken down holds, for both a member and the moderator.

Nothing needs to change before merge.

Merged as b888f9c