Skip to content

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

Merged
qdaxb merged 1 commit into
wecode-ai:mainfrom
FicoHu:fix/cloud-project-creation
Aug 4, 2026
Merged

fix(backend): preserve nullable loop item foreign keys#2419
qdaxb merged 1 commit into
wecode-ai:mainfrom
FicoHu:fix/cloud-project-creation

Conversation

@FicoHu

@FicoHu FicoHu commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of optional delivery fields when saving and updating items on MySQL.
    • Preserved empty parent and due-date values while converting only required completion dates.
    • Applied consistent behavior during both item updates and task status changes.
  • Tests

    • Added regression coverage for MySQL date and parent-field handling.

@coderabbitai

coderabbitai Bot commented Aug 4, 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: 14862198-a952-4ceb-bb78-adda12095608

📥 Commits

Reviewing files that changed from the base of the PR and between 6a232fc 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

The change adds cached SQLAlchemy schema inspection for loop_items. MySQL sentinel conversion now targets only non-nullable attributes. Insert, TODO update, and task-start flows use the detected attributes. Tests cover nullable parent_id and due_at.

Changes

MySQL null adaptation

Layer / File(s) Summary
Schema-aware value adaptation
backend/app/models/delivery.py
The delivery model detects and caches non-nullable loop_items attributes. MySQL adaptation and insert handling use this set.
Loop-item service integration
backend/app/services/loop_items/service.py, backend/tests/schemas/test_delivery.py
TODO updates and task-start transitions use schema-derived attributes. Tests verify selective sentinel conversion for MySQL values.

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

Possibly related PRs

Suggested reviewers: micro66

🚥 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 database adaptation.
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.

@qdaxb
qdaxb added this pull request to the merge queue Aug 4, 2026
Merged via the queue into wecode-ai:main with commit 47f0ad1 Aug 4, 2026
38 checks passed
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.

2 participants