fix: preserve chatflow id on API create#6419
Open
puneetdixit200 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request enables the preservation of caller-provided IDs during chatflow creation, which is necessary for importing flows. It introduces validation logic to ensure that provided IDs are valid UUIDs and do not conflict with existing records, along with comprehensive unit tests for both the controller and service layers. Review feedback identifies that using Object.prototype.hasOwnProperty.call on a class instance may be unreliable due to TypeScript property initialization behavior and suggests using a nullish check instead.
Author
|
Pushed Verified:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
idwhen creating a chatflow through the API, so exported flows can be restored with their original ID.Fixes #6418
Testing
npx --yes pnpm@10.26.0 --filter flowise-components buildnpx --yes pnpm@10.26.0 --dir packages/server exec jest src/controllers/chatflows/index.test.ts --runInBandnpx --yes pnpm@10.26.0 --dir packages/server exec jest src/services/chatflows/index.test.ts --runInBandnpx --yes pnpm@10.26.0 exec prettier --check packages/server/src/controllers/chatflows/index.ts packages/server/src/controllers/chatflows/index.test.ts packages/server/src/services/chatflows/index.ts packages/server/src/services/chatflows/index.test.tsnpx --yes pnpm@10.26.0 exec eslint packages/server/src/controllers/chatflows/index.ts packages/server/src/controllers/chatflows/index.test.ts packages/server/src/services/chatflows/index.ts packages/server/src/services/chatflows/index.test.tsgit diff --check