Compare commits

...

5 Commits

Author SHA1 Message Date
wangxiaolei
acfd34e876 fix: fix Cannot destructure property 'name' of 'value' as it is undef… (#30991) 2026-01-15 13:25:30 +08:00
-LAN-
036a7cf839 chore: bump version to 1.11.4 (#30961) 2026-01-15 11:40:33 +08:00
Stephen Zhou
86beacc64f build: require node 24.13.0 (#30945) 2026-01-15 11:40:27 +08:00
wangxiaolei
2c6bd90d6f fix: fix missing id and message_id (#31008) 2026-01-15 11:40:13 +08:00
Stephen Zhou
f5aaa8f97e fix: redirect after login (#30985) 2026-01-15 11:40:02 +08:00
19 changed files with 49 additions and 36 deletions

View File

@@ -90,7 +90,7 @@ jobs:
uses: actions/setup-node@v6 uses: actions/setup-node@v6
if: steps.changed-files.outputs.any_changed == 'true' if: steps.changed-files.outputs.any_changed == 'true'
with: with:
node-version: 22 node-version: 24
cache: pnpm cache: pnpm
cache-dependency-path: ./web/pnpm-lock.yaml cache-dependency-path: ./web/pnpm-lock.yaml

View File

@@ -16,10 +16,6 @@ jobs:
name: unit test for Node.js SDK name: unit test for Node.js SDK
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20, 22]
defaults: defaults:
run: run:
working-directory: sdks/nodejs-client working-directory: sdks/nodejs-client
@@ -29,10 +25,10 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js
uses: actions/setup-node@v6 uses: actions/setup-node@v6
with: with:
node-version: ${{ matrix.node-version }} node-version: 24
cache: '' cache: ''
cache-dependency-path: 'pnpm-lock.yaml' cache-dependency-path: 'pnpm-lock.yaml'

View File

@@ -57,7 +57,7 @@ jobs:
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v6 uses: actions/setup-node@v6
with: with:
node-version: 'lts/*' node-version: 24
cache: pnpm cache: pnpm
cache-dependency-path: ./web/pnpm-lock.yaml cache-dependency-path: ./web/pnpm-lock.yaml

View File

@@ -31,7 +31,7 @@ jobs:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v6 uses: actions/setup-node@v6
with: with:
node-version: 22 node-version: 24
cache: pnpm cache: pnpm
cache-dependency-path: ./web/pnpm-lock.yaml cache-dependency-path: ./web/pnpm-lock.yaml

View File

@@ -2,6 +2,7 @@ from __future__ import annotations
from datetime import datetime from datetime import datetime
from typing import TypeAlias from typing import TypeAlias
from uuid import uuid4
from pydantic import BaseModel, ConfigDict, Field, field_validator from pydantic import BaseModel, ConfigDict, Field, field_validator
@@ -20,8 +21,8 @@ class SimpleFeedback(ResponseModel):
class RetrieverResource(ResponseModel): class RetrieverResource(ResponseModel):
id: str id: str = Field(default_factory=lambda: str(uuid4()))
message_id: str message_id: str = Field(default_factory=lambda: str(uuid4()))
position: int position: int
dataset_id: str | None = None dataset_id: str | None = None
dataset_name: str | None = None dataset_name: str | None = None

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "dify-api" name = "dify-api"
version = "1.11.3" version = "1.11.4"
requires-python = ">=3.11,<3.13" requires-python = ">=3.11,<3.13"
dependencies = [ dependencies = [

2
api/uv.lock generated
View File

@@ -1368,7 +1368,7 @@ wheels = [
[[package]] [[package]]
name = "dify-api" name = "dify-api"
version = "1.11.3" version = "1.11.4"
source = { virtual = "." } source = { virtual = "." }
dependencies = [ dependencies = [
{ name = "aliyun-log-python-sdk" }, { name = "aliyun-log-python-sdk" },

View File

@@ -21,7 +21,7 @@ services:
# API service # API service
api: api:
image: langgenius/dify-api:1.11.3 image: langgenius/dify-api:1.11.4
restart: always restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
@@ -63,7 +63,7 @@ services:
# worker service # worker service
# The Celery worker for processing all queues (dataset, workflow, mail, etc.) # The Celery worker for processing all queues (dataset, workflow, mail, etc.)
worker: worker:
image: langgenius/dify-api:1.11.3 image: langgenius/dify-api:1.11.4
restart: always restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
@@ -102,7 +102,7 @@ services:
# worker_beat service # worker_beat service
# Celery beat for scheduling periodic tasks. # Celery beat for scheduling periodic tasks.
worker_beat: worker_beat:
image: langgenius/dify-api:1.11.3 image: langgenius/dify-api:1.11.4
restart: always restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
@@ -132,7 +132,7 @@ services:
# Frontend web application. # Frontend web application.
web: web:
image: langgenius/dify-web:1.11.3 image: langgenius/dify-web:1.11.4
restart: always restart: always
environment: environment:
CONSOLE_API_URL: ${CONSOLE_API_URL:-} CONSOLE_API_URL: ${CONSOLE_API_URL:-}

View File

@@ -704,7 +704,7 @@ services:
# API service # API service
api: api:
image: langgenius/dify-api:1.11.3 image: langgenius/dify-api:1.11.4
restart: always restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
@@ -746,7 +746,7 @@ services:
# worker service # worker service
# The Celery worker for processing all queues (dataset, workflow, mail, etc.) # The Celery worker for processing all queues (dataset, workflow, mail, etc.)
worker: worker:
image: langgenius/dify-api:1.11.3 image: langgenius/dify-api:1.11.4
restart: always restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
@@ -785,7 +785,7 @@ services:
# worker_beat service # worker_beat service
# Celery beat for scheduling periodic tasks. # Celery beat for scheduling periodic tasks.
worker_beat: worker_beat:
image: langgenius/dify-api:1.11.3 image: langgenius/dify-api:1.11.4
restart: always restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
@@ -815,7 +815,7 @@ services:
# Frontend web application. # Frontend web application.
web: web:
image: langgenius/dify-web:1.11.3 image: langgenius/dify-web:1.11.4
restart: always restart: always
environment: environment:
CONSOLE_API_URL: ${CONSOLE_API_URL:-} CONSOLE_API_URL: ${CONSOLE_API_URL:-}

View File

@@ -1 +1 @@
22.21.1 24

View File

@@ -1,5 +1,5 @@
# base image # base image
FROM node:22.21.1-alpine3.23 AS base FROM node:24-alpine AS base
LABEL maintainer="takatost@gmail.com" LABEL maintainer="takatost@gmail.com"
# if you located in China, you can use aliyun mirror to speed up # if you located in China, you can use aliyun mirror to speed up

View File

@@ -8,8 +8,8 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next
Before starting the web frontend service, please make sure the following environment is ready. Before starting the web frontend service, please make sure the following environment is ready.
- [Node.js](https://nodejs.org) >= v22.11.x - [Node.js](https://nodejs.org)
- [pnpm](https://pnpm.io) v10.x - [pnpm](https://pnpm.io)
> [!TIP] > [!TIP]
> It is recommended to install and enable Corepack to manage package manager versions automatically: > It is recommended to install and enable Corepack to manage package manager versions automatically:

View File

@@ -66,7 +66,9 @@ export default function CheckCode() {
setIsLoading(true) setIsLoading(true)
const ret = await webAppEmailLoginWithCode({ email, code: encryptVerificationCode(code), token }) const ret = await webAppEmailLoginWithCode({ email, code: encryptVerificationCode(code), token })
if (ret.result === 'success') { if (ret.result === 'success') {
setWebAppAccessToken(ret.data.access_token) if (ret?.data?.access_token) {
setWebAppAccessToken(ret.data.access_token)
}
const { access_token } = await fetchAccessToken({ const { access_token } = await fetchAccessToken({
appCode: appCode!, appCode: appCode!,
userId: embeddedUserId || undefined, userId: embeddedUserId || undefined,

View File

@@ -82,7 +82,9 @@ export default function MailAndPasswordAuth({ isEmailSetup }: MailAndPasswordAut
body: loginData, body: loginData,
}) })
if (res.result === 'success') { if (res.result === 'success') {
setWebAppAccessToken(res.data.access_token) if (res?.data?.access_token) {
setWebAppAccessToken(res.data.access_token)
}
const { access_token } = await fetchAccessToken({ const { access_token } = await fetchAccessToken({
appCode: appCode!, appCode: appCode!,

View File

@@ -362,6 +362,18 @@ describe('PreviewDocumentPicker', () => {
expect(screen.getByText('--')).toBeInTheDocument() expect(screen.getByText('--')).toBeInTheDocument()
}) })
it('should render when value prop is omitted (optional)', () => {
const files = createMockDocumentList(2)
const onChange = vi.fn()
// Do not pass `value` at all to verify optional behavior
render(<PreviewDocumentPicker files={files} onChange={onChange} />)
// Renders placeholder for missing name
expect(screen.getByText('--')).toBeInTheDocument()
// Portal wrapper renders
expect(screen.getByTestId('portal-elem')).toBeInTheDocument()
})
it('should handle empty files array', () => { it('should handle empty files array', () => {
renderComponent({ files: [] }) renderComponent({ files: [] })

View File

@@ -18,7 +18,7 @@ import DocumentList from './document-list'
type Props = { type Props = {
className?: string className?: string
value: DocumentItem value?: DocumentItem
files: DocumentItem[] files: DocumentItem[]
onChange: (value: DocumentItem) => void onChange: (value: DocumentItem) => void
} }
@@ -30,7 +30,8 @@ const PreviewDocumentPicker: FC<Props> = ({
onChange, onChange,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const { name, extension } = value const name = value?.name || ''
const extension = value?.extension
const [open, { const [open, {
set: setOpen, set: setOpen,

View File

@@ -65,8 +65,10 @@ export default function MailAndPasswordAuth({ isInvite, isEmailSetup, allowRegis
body: loginData, body: loginData,
}) })
if (res.result === 'success') { if (res.result === 'success') {
// Track login success event if (res?.data?.access_token) {
setWebAppAccessToken(res.data.access_token) // Track login success event
setWebAppAccessToken(res.data.access_token)
}
trackEvent('user_login_success', { trackEvent('user_login_success', {
method: 'email_password', method: 'email_password',
is_invite: isInvite, is_invite: isInvite,

View File

@@ -1,7 +1,7 @@
{ {
"name": "dify-web", "name": "dify-web",
"type": "module", "type": "module",
"version": "1.11.3", "version": "1.11.4",
"private": true, "private": true,
"packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a", "packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a",
"imports": { "imports": {
@@ -10,9 +10,6 @@
"default": "./i18n-config/lib.client.ts" "default": "./i18n-config/lib.client.ts"
} }
}, },
"engines": {
"node": ">=22.12.0"
},
"browserslist": [ "browserslist": [
"last 1 Chrome version", "last 1 Chrome version",
"last 1 Firefox version", "last 1 Firefox version",

View File

@@ -39,7 +39,7 @@ import { del, get, patch, post, put } from './base'
type LoginSuccess = { type LoginSuccess = {
result: 'success' result: 'success'
data: { access_token: string } data?: { access_token?: string }
} }
type LoginFail = { type LoginFail = {
result: 'fail' result: 'fail'