🐛 fix(pages): use page.description_json in track_page_version#9281
🐛 fix(pages): use page.description_json in track_page_version#9281cosmic-fire-eng wants to merge 1 commit into
Conversation
track_page_version read page.description when populating a PageVersion. The description field was removed from the Page model, so every invocation raised AttributeError: 'Page' object has no attribute 'description'. Because the task body is wrapped in except Exception: log_exception(e); return, the failure was swallowed and no version was ever written — page version-history silently stopped working with no user-visible error. Use page.description_json (the current field) in both the update-existing and create-new version paths, and add unit tests covering the create path, in-place update, the no-op case, post-timeout new version, and a sentinel asserting Page has no bare description attribute. Co-Authored-By: Claude <noreply@anthropic.com>
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Celery task ChangesPageVersion description_json fix and tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
track_page_versionreadspage.descriptionwhen populating aPageVersion. Thedescriptionfield no longer exists on thePagemodel (onlydescription_json/description_binary/description_html/description_stripped), so every invocation raisesAttributeError: 'Page' object has no attribute 'description'. Because the task body is wrapped inexcept Exception: log_exception(e); return, the failure is swallowed and no version is ever written — page version-history silently stops working with no user-visible error.Fix: use
page.description_json(the current field) in both the update-existing-version and create-new-version paths.Tests: adds
apps/api/plane/tests/unit/bg_tasks/test_page_version_task.pycovering: the create path persistsdescription_json; an in-place update within the timeout window; the no-op case whendescription_htmlis unchanged; a fresh version afterPAGE_VERSION_TASK_TIMEOUT; and a sentinel assertingPagehas no baredescriptionattribute. With the oldpage.description, the persistence tests fail (0 versions written); after the fix they pass.Summary by CodeRabbit
Release Notes
Bug Fixes
Tests