Class: Moderate::Services::ResolveFlag

Inherits:
Object
  • Object
show all
Defined in:
lib/moderate/services/resolve_flag.rb

Overview

ResolveFlag — the decision on an auto-filter ‘Moderate::Flag`, behind the flag’s ‘action!` / `dismiss!`.

A Flag is a SYSTEM-raised queue item (the wordlist/image/external classifier tripped on a ‘:flag`-mode field, or a human filed one manually) — it’s the “ongoing moderation” surface Apple Guideline 1.2 and Google Play UGC expect:

- https://developer.apple.com/app-store/review/guidelines/#user-generated-content
- https://support.google.com/googleplay/android-developer/answer/9876937

A flag is lighter than a report: there’s no reporter to inform and no appeal window to stamp (an appeal attaches to a report decision, not to a raw queue item). So this service is the simplest of the resolvers — atomic transition, mandatory note, audit — but it follows the same discipline:

- `with_lock` + re-check `pending?` inside the lock for idempotency under
  concurrent review;
- a NOTE IS MANDATORY (the moderator's rationale is the audit trail);
- the decision is recorded via `Moderate.audit`, never a host-specific log.

NOTE: unlike ResolveReport, resolving a flag does NOT itself run content removal/bans. A flag marks “this needs a look”; the enforcement decision is a report concern. If a moderator wants to remove the flagged content, they file /resolve a report on it. This keeps the flag a pure triage record and avoids two divergent enforcement paths. (Documented so a maintainer doesn’t “helpfully” add removal here and create that divergence.)

Instance Method Summary collapse

Constructor Details

#initialize(flag, by:) ⇒ ResolveFlag

Returns a new instance of ResolveFlag.



30
31
32
33
# File 'lib/moderate/services/resolve_flag.rb', line 30

def initialize(flag, by:)
  @flag = flag
  @moderator = by
end

Instance Method Details

#action!(note:) ⇒ Object

The flagged content was indeed objectionable — mark the flag actioned. (Any actual takedown is done by acting on a report; see the class note.)



37
38
39
# File 'lib/moderate/services/resolve_flag.rb', line 37

def action!(note:)
  transition!("actioned", note)
end

#dismiss!(note:) ⇒ Object

False positive / acceptable — dismiss the flag.



42
43
44
# File 'lib/moderate/services/resolve_flag.rb', line 42

def dismiss!(note:)
  transition!("dismissed", note)
end