Skip to content

🧹 Refactor long function repair_projections - #14

Merged
undivisible merged 2 commits into
mainfrom
fix/code-health-refactor-repair-projections-9740762068267299176
Aug 12, 2026
Merged

🧹 Refactor long function repair_projections#14
undivisible merged 2 commits into
mainfrom
fix/code-health-refactor-repair-projections-9740762068267299176

Conversation

@undivisible

@undivisible undivisible commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🎯 What: The code health issue addressed was a long and complex function repair_projections in src/store/repair.rs. This function handled row fetching, logic branching, and complex transaction logic all inline. The solution extracts the logic into two separate functions: fetch_repair_outbox_rows and process_repair_target.
💡 Why: How this improves maintainability: by extracting the database selection and the row processing into their own helper functions, it becomes significantly easier to read, follow, and potentially test in the future. The top-level function is now small and declarative.
Verification: How I confirmed the change is safe: ran cargo test which successfully passed all 117 tests. cargo clippy passed cleanly as well.
Result: The improvement achieved: shorter, more declarative code which is much more maintainable while strictly preserving existing functionality.


PR created automatically by Jules for task 9740762068267299176 started by @undivisible


Note

Low Risk
Pure structural refactor of repair logic with identical SQL and control flow; no API or data-handling changes.

Overview
Breaks up the long repair_projections method by extracting fetch_repair_outbox_rows and process_repair_target, so the top-level flow is shorter and easier to follow.

No functional changes: outbox fetching, stale embedding cleanup, and FTS deletion for missing sources behave the same as before.

Reviewed by Cursor Bugbot for commit 57b3375. Configure here.

Extract `fetch_repair_outbox_rows` and `process_repair_target` out of
`repair_projections` to improve readability and maintainability.
No behavior change.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ea8e9f10-865d-4b51-aefc-67df616a77da)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9808e7ae2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread patch.diff Outdated
@@ -0,0 +1,234 @@
--- src/store/repair.rs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the generated patch artifact

This adds a 234-line patch file that merely duplicates the already-applied src/store/repair.rs changes. Because Cargo.toml does not exclude it, the tracked artifact will also be included in published source packages and can become stale or misleading as the implementation evolves; it should not be committed.

Useful? React with 👍 / 👎.

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_cbc75336-b372-47cb-92b2-9b460ac95231)

@undivisible
undivisible merged commit 1d55467 into main Aug 12, 2026
7 checks passed
@undivisible
undivisible deleted the fix/code-health-refactor-repair-projections-9740762068267299176 branch August 12, 2026 03:29
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