Repository navigation
fix: skip external image srcs when duplicating page assets - #9938
pablohashescobar wants to merge 1 commit into
Conversation
- External image URLs (e.g. https://media.docs.plane.so/...) were passed through to FileAsset.objects.filter(id__in=...), which raised "is not a valid UUID" and aborted the whole asset copy on page duplicate. - Filter extract_asset_ids to UUID srcs only, since uploaded assets are the only ones that carry a UUID. - Add a unit test covering UUID, external URL, and missing-src tags.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesAsset ID filtering
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Normal uploaded asset references remain eligible for copying, while external image URLs are excluded. No actionable merge risk is established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change tightens image-ID handling while preserving existing permissions and asset-copy restrictions. No introduced vulnerability was established, but external-image handling during conversion and recovery from interrupted duplication were not fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused validation fix correctly addresses the failure and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Filters page asset sources to valid UUIDs, preventing external image URLs from breaking page duplication.
Changes:
- Validates extracted asset IDs before database queries.
- Adds regression coverage for external and missing image sources.
| File | Description |
|---|---|
apps/api/plane/bgtasks/copy_s3_object.py |
Skips non-UUID image sources during asset extraction. |
apps/api/plane/tests/unit/bg_tasks/test_copy_s3_objects.py |
Tests UUID extraction with external and missing sources. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
Duplicating a page that contains an external image (e.g.
https://media.docs.plane.so/seed_assets/31.png) failed with"... is not a valid UUID".extract_asset_idsreturned everysrcit found, and those were passed toFileAsset.objects.filter(id__in=...), which aborted the whole asset copy.extract_asset_idsnow keeps onlysrcvalues that are valid UUIDs (using the existingis_valid_uuidhelper). Uploaded assets are still copied; external URLs are left as-is in the duplicated page.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
test_extract_asset_ids_skips_external_urls: a UUID src is returned, an external URL src and a missing src are skipped.References
🤖 Generated with Claude Code
Summary by CodeRabbit