Skip to content

devvit: onModAction trigger re-fetches full mod log, contradicts architecture §3 #61

Description

@bakerboy448

Problem

Architecture spec devvit-migration/docs/04-architecture.md:246 (§3, "Execution Model Decision") specifies the onModAction trigger:

does NOT call getModerationLog and does NOT publish. Cheap, idempotent, self-loop-safe.

The shipped trigger contradicts this:

  • devvit/src/main.ts:174-191 — the ModAction trigger calls ingest(reddit, redis, cfg) on every single mod action.
  • devvit/src/modlog.ts:219-246 — ingest unconditionally calls fetchActions.
  • devvit/src/modlog.ts:191-202 — fetchActions issues reddit.getModerationLog({ subredditName, limit: cfg.fetchLimit, pageSize: 100 }).all(), a full listing re-fetch, not an incremental single-event ingest.

This means every moderation action on the subreddit triggers a full moderation-log re-fetch, not the cheap dirty-flag-only path the architecture decision describes. Also contradicts NFR-6 (devvit-migration/docs/01-requirements.md:149) which bounds normal-run cost assuming incremental ingest; a full re-fetch per action multiplies read-API load under active moderation and doesn't scale the way the architecture doc assumed when making the cron-primary/trigger-ingest tradeoff.

Fix

Either:

  1. Make the trigger truly incremental — extract/dedup/persist the single ModAction event payload directly (no getModerationLog call), matching architecture §3's stated design, or
  2. If a full re-fetch on every trigger is intentional, update 04-architecture.md §3 to reflect that and re-evaluate whether the cron-primary design still holds (it was chosen partly because the trigger was assumed cheap).

References

PR #34 (feat/devvit-migration), devvit-migration/docs/STATUS.md §7b.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions