Originally created by: Akarsh-Hegde
Fixes the critical CodeRabbit finding on PR [#440] (src/intelligence/providers/jira/mod.rs), split into its own PR because it reorders live daemon-sync logic and deserves review in isolation.
backfill_worklogged ran unconditionally at the top of refresh_if_stale, before the SYNC_INTERVAL_MINS (5 min) freshness check. A Jira ticket that has pm_worklogs rows but was permanently deleted/moved never comes back from fetch_by_keys, so it stays in the "missing" set forever. Result: on every poll tick, the daemon re-ran auth resolution + start-date-field discovery + an issue fetch for that dead ticket — a genuine rate-limit / ban hazard.
ctx) and start_date_field are already resolved for the regular sync.ctx + start_date_field into backfill_worklogged so it reuses them instead of re-resolving (removes the duplicate auth + field-discovery round-trips).Net effect: a dead ticket is re-attempted at most once per sync cycle (same cadence as the regular sync), not once per tick. Still best-effort — a backfill failure never blocks the main sync.
A dedicated tombstone column to stop re-fetching a confirmed-dead ticket entirely would remove even the once-per-cycle attempt, but needs its own schema change — left as follow-up. The gate alone removes the unbounded-per-tick hazard, which is the critical part.
cargo build / cargo clippy -- -D warnings / cargo fmt --check: cleancargo test --lib intelligence::providers::jira: 18 pass🤖 Generated with Claude Code
Originally posted by: coderabbitai[bot]
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/jira-backfill-rate-limit`Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.Ticket changed by: Akarsh-Hegde