-
Notifications
You must be signed in to change notification settings - Fork 0
fix: remove hardcoded 48-character limit from text inputs #5
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
base: codex_full_base_fix_remove_hardcoded_48-character_limit_from_text_inputs_pr5
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ import DifyLogo from '@/app/components/base/logo/dify-logo' | |
| import Toast from '@/app/components/base/toast' | ||
| import Res from '@/app/components/share/text-generation/result' | ||
| import RunOnce from '@/app/components/share/text-generation/run-once' | ||
| import { appDefaultIconBackground, BATCH_CONCURRENCY, DEFAULT_VALUE_MAX_LEN } from '@/config' | ||
| import { appDefaultIconBackground, BATCH_CONCURRENCY } from '@/config' | ||
| import { useGlobalPublicStore } from '@/context/global-public-context' | ||
| import { useWebAppStore } from '@/context/web-app-context' | ||
| import { useAppFavicon } from '@/hooks/use-app-favicon' | ||
|
|
@@ -196,6 +196,7 @@ const TextGeneration: FC<IMainProps> = ({ | |
| return false | ||
| } | ||
| const headerData = data[0] | ||
| console.log('Checking batch inputs:', { dataLength: data.length, headerData }) | ||
| let isMapVarName = true | ||
| promptConfig?.prompt_variables.forEach((item, index) => { | ||
| if (!isMapVarName) | ||
|
|
@@ -257,10 +258,9 @@ const TextGeneration: FC<IMainProps> = ({ | |
| if (errorRowIndex !== 0) | ||
| return | ||
| if (varItem.type === 'string') { | ||
| const maxLen = varItem.max_length || DEFAULT_VALUE_MAX_LEN | ||
| if (item[varIndex].length > maxLen) { | ||
| if (item[varIndex].length > varItem.max_length) { | ||
| moreThanMaxLengthVarName = varItem.name | ||
|
Comment on lines
260
to
262
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new comparison uses Useful? React with 👍 / 👎. |
||
| maxLength = maxLen | ||
| maxLength = varItem.max_length | ||
| errorRowIndex = index + 1 | ||
| return | ||
| } | ||
|
|
||
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.
This adds a
console.login the share text-generation batch validator, which violates the repo’s frontend rule forbidding console statements and can leak user-supplied CSV header data in production. That can trip lint checks and expose sensitive inputs in the browser console; please remove it or gate it behind a debug-only logger.Useful? React with 👍 / 👎.