Skip to content

[FXC-6492] fix(): validate ImportedSurface DraftContext before draft submission#1910

Merged
benflexcompute merged 1 commit intorelease-candidate/25.8from
BenY/FXC-6492-validate-before-draft-submit
Mar 19, 2026
Merged

[FXC-6492] fix(): validate ImportedSurface DraftContext before draft submission#1910
benflexcompute merged 1 commit intorelease-candidate/25.8from
BenY/FXC-6492-validate-before-draft-submit

Conversation

@benflexcompute
Copy link
Copy Markdown
Collaborator

@benflexcompute benflexcompute commented Mar 19, 2026

Summary

  • Move the ImportedSurface-requires-DraftContext guard check before Draft.create(...).submit() to prevent orphan server-side drafts when validation fails.
  • Previously the validation ran after the draft was already created on the server, leaving behind orphan drafts on every failed attempt.

Test plan

  • Verify that calling run() with ImportedSurface outside a DraftContext raises Flow360ValueError without creating a server-side draft
  • Verify that the happy path (ImportedSurface inside DraftContext) still works correctly

🤖 Generated with Claude Code


Note

Low Risk
Low risk change that only reorders a precondition check in Project._run; main impact is on when an error is raised during submission, not on successful runs.

Overview
Prevents orphan server-side drafts by moving the ImportedSurface-requires-DraftContext guard to run before Draft.create(...).submit() in Project._run.

Now, calling run() with params.private_attribute_asset_cache.imported_surfaces outside an active draft context fails fast with Flow360ValueError without creating a draft.

Written by Cursor Bugbot for commit a312867. This will update automatically on new commits. Configure here.

…submission

Move the ImportedSurface-requires-DraftContext guard check before
Draft.create(...).submit() to prevent orphan drafts on the server
when the validation fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benflexcompute benflexcompute merged commit cbcac7d into release-candidate/25.8 Mar 19, 2026
20 checks passed
@benflexcompute benflexcompute deleted the BenY/FXC-6492-validate-before-draft-submit branch March 19, 2026 18:54
github-actions Bot pushed a commit that referenced this pull request Mar 19, 2026
…submission (#1910)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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