Skip to content

fix(backend): preserve nullable loop item foreign keys - #2431

Closed
FicoHu wants to merge 1 commit into
wecode-ai:mainfrom
FicoHu:fix/cloud-project-creation
Closed

fix(backend): preserve nullable loop item foreign keys#2431
FicoHu wants to merge 1 commit into
wecode-ai:mainfrom
FicoHu:fix/cloud-project-creation

Conversation

@FicoHu

@FicoHu FicoHu commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility with MySQL databases by preserving NULL values in nullable loop-item fields.
    • Ensured automatic status updates and TODO updates only substitute placeholder values where database constraints require them.
  • Tests

    • Added coverage confirming nullable fields retain their NULL values during updates.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a77eda0-ce3f-40d4-8685-7753305659c3

📥 Commits

Reviewing files that changed from the base of the PR and between 5064867 and e108cb6.

📒 Files selected for processing (3)
  • backend/app/models/delivery.py
  • backend/app/services/loop_items/service.py
  • backend/tests/schemas/test_delivery.py

📝 Walkthrough

Walkthrough

MySQL loop-item value adaptation now inspects loop_items nullability and caches the result per connection. Inserts, explicit updates, and automatic status transitions apply sentinel values only to non-nullable attributes. Tests cover nullable parent_id and due_at.

Changes

LoopNode null adaptation

Layer / File(s) Summary
Schema-aware value adaptation
backend/app/models/delivery.py, backend/tests/schemas/test_delivery.py
MySQL adaptation accepts a non-nullable attribute set. Schema inspection reads and caches loop_items metadata. Inserts use the detected attributes. Tests preserve None for nullable fields.
Service update integration
backend/app/services/loop_items/service.py
Explicit updates and automatic TODO transitions pass the connection-specific non-nullable attributes to dialect adaptation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: qdaxb

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preserving nullable loop item foreign keys during backend updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@FicoHu FicoHu closed this Aug 5, 2026
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