Skip to content

feat(src): configure Discord to Linear backfills - #63

Draft
phorcys420 wants to merge 1 commit into
mainfrom
phorcys/linear-backfill-config
Draft

feat(src): configure Discord to Linear backfills#63
phorcys420 wants to merge 1 commit into
mainfrom
phorcys/linear-backfill-config

Conversation

@phorcys420

Copy link
Copy Markdown
Member

Makes the Discord to Linear backfills configurable.

Config

Under linearBridge:

  • backfill.enabled (default true): on the first live event of an unmapped #help thread, mirror the thread's full history instead of just that event, so a thread opened while the bridge was off still lands complete.
  • deepBackfill.days (default 90): startup import that walks back through #help history. Mirrors every thread active within that many days. -1 imports everything (pages all archived threads, retries through rate limits); 0 disables the startup import.
  • deepBackfill.limit (default -1): caps how many threads the startup import mirrors, most recent first. -1 is unlimited; 0 skips the import entirely.

The old backfillAll flag is replaced by deepBackfill.days = -1.

All three are env-overridable and coerced to their real types after load (configmasher hands back strings).

Implementation notes
  • backfill moved from a bare boolean to backfill.enabled to leave room for future backfill options.
  • Live catch-up (caughtUp) runs on MessageCreate and the debounced ThreadUpdate. It skips already-mirrored posts (Mirror.isMirrored) and routes through withRateLimitRetry, announcing the Linear issue link back to the thread. Reaction events are intentionally excluded to avoid duplicating the catch-up.
  • Startup backfill() pages archived threads in batches of 100, stops paging once a windowed import passes the day cutoff, sorts by latest message, applies the day window, then the limit cap.
  • deepBackfill.limit === 0 early-returns before any Discord paging.
  • backfillThread gained an announce flag: off for the bulk startup import, on for live catch-up.
  • Negative days/limit values are treated as the unlimited sentinel (-1); no strict validation added.

Generated by Coder Agents on behalf of @phorcys420.

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.

1 participant