-
Notifications
You must be signed in to change notification settings - Fork 50
fix(spx-gui): filter failed/incomplete tasks in asset-adoption #2825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Only include successfully completed tasks when calling /aigc/asset-adoption. This prevents 400 errors when the payload contains failed/incomplete task IDs. - Modified getTaskIds() in animation-gen.ts, costume-gen.ts to check TaskStatus.Completed - Modified recordAdoption() in sprite-gen.ts, backdrop-gen.ts to filter completed tasks Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
|
@xgopilot add test case for the change, and fix the CI problem in this PR. |
Task completed! ✅I've successfully added test cases for the task status filtering changes and fixed the CI lint issue. What was done:
Test coverage:The tests cover all scenarios:
CI Status:The CI checks are now running with the new commit. The lint check should pass as it does locally. Commit: c9b116a - "test(spx-gui): add tests for task status filtering in asset adoption" |
Add comprehensive test cases to verify that only completed tasks are included in asset adoption and getTaskIds() methods: - backdrop-gen.test.ts: Test recordAdoption filters by TaskStatus.Completed - costume-gen.test.ts: Test getTaskIds filters by TaskStatus.Completed - animation-gen.test.ts: Test getTaskIds with multiple tasks and mixed statuses - sprite-gen.test.ts: Test recordAdoption with complex scenarios including failed and cancelled tasks These tests ensure that the fix for #2824 works correctly by preventing HTTP 400 errors when failed/incomplete tasks are present. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
…g behavior Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
- Add helper methods to MockAigcApis (setTaskStatus, getLastTask, getTasksByType) - Update all test files to use MockAigcApis instead of accessing private task fields - This fixes TypeScript errors in CI where tests were accessing private properties Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
nighca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xgopilot 解决 CI 中的问题,具体 CI 会检查什么你可以在 https://github.com/goplus/builder/blob/dev/.github/workflows/validate.yml 中看到
Task completed! ✅I've successfully fixed the CI formatting issue. What was done:
Summary:The CI was failing because |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Remove helper methods (setTaskStatus, getLastTask, getTasksByType) from MockAigcApis and let test code access the tasks Map directly. This provides a simpler, more flexible API where tests can implement their own filtering and manipulation logic. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
|
@xgopilot fix the CI. There's still format-check issue. |
…lues Replace optional chaining (?.) and if checks with non-null assertions (!) in test cases where values are known to exist. This makes the test code more assertive and cleaner. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Task completed! ✅I've successfully fixed the Prettier formatting issues in the CI. What was done:
Commit: c866ca4 - "chore(spx-gui): fix prettier formatting in test files" The CI format-check should now pass! ✨ |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
|
@xgopilot 修复测试用例 |
Task completed! ✅I've successfully fixed the test cases by applying non-null assertions consistently across all test files. What was done:
Commit: af69ff7 - "fix(spx-gui): use non-null assertions for cancel test scenarios" All test cases now consistently use non-null assertions ( |
Apply non-null assertions (!) to lastRecord in cancel test scenarios where we know the value exists after task cancellation. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Task: Remove all test case changes, keep only implementation changesTodo List:
SummaryAll test case changes have been successfully removed. The branch now contains only the implementation changes: Files with changes retained:
Test files reverted:
The implementation changes correctly filter tasks by |
Remove all changes to test files as requested, keeping only the core implementation changes that filter failed/incomplete tasks in asset adoption. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Requested by @nighca
Fixes #2824
Summary
This PR fixes the issue where asset adoption fails with HTTP 400 when the payload contains failed or incomplete task IDs.
Frontend changes:
getTaskIds()methods inanimation-gen.tsandcostume-gen.tsto only return task IDs for completed tasksrecordAdoption()methods insprite-gen.tsandbackdrop-gen.tsto only include completed task IDsTaskStatusimport where needed to check task completion statusChanges
spx-gui/src/models/gen/animation-gen.ts: Filter tasks byTaskStatus.Completedstatusspx-gui/src/models/gen/costume-gen.ts: Filter tasks byTaskStatus.Completedstatusspx-gui/src/models/gen/sprite-gen.ts: Filter main generation task by completion statusspx-gui/src/models/gen/backdrop-gen.ts: Filter generation task by completion statusTesting
After this change, when a generation session contains failed/incomplete tasks, asset adoption will only submit task IDs for successfully completed tasks, preventing 400 errors.
Related PR
Backend fix: goplus/builder-backend (will be created separately)