From a89d61b27d88cd473157a3844210a02ab2640b36 Mon Sep 17 00:00:00 2001 From: d0zingcat Date: Sat, 17 Jan 2026 15:48:47 +0800 Subject: [PATCH] feat: bump version and add changelog.en Signed-off-by: d0zingcat --- CHANGELOG.md | 216 ++++++++++++++++++--------------------- CHANGELOG.zh-CN.md | 171 +++++++++++++++++++++++++++++++ README.zh-CN.md | 2 +- apps/server/package.json | 4 +- apps/web/package.json | 4 +- docs/copilot-context.md | 6 +- todo.md | 1 + 7 files changed, 281 insertions(+), 123 deletions(-) create mode 100644 CHANGELOG.zh-CN.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a9fff4e..ce625b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,162 +1,144 @@ -# 更新日志 +# Changelog -本项目的所有显著变更都将记录在此文件中。 +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +**CHANGELOG** | [简体中文](./CHANGELOG.zh-CN.md) + +## [1.3.3] - 2026-01-17 + +### Added +- **Multi-replica Deployment Support**: Enhanced stability for load-balanced/multi-instance environments. + - **Database Locking**: Introduced **Postgres Advisory Locks** in `db:migrate:deploy` script to prevent race conditions during concurrent database migrations. + - **Idempotency Hardening**: Verified and ensured Feishu event handling logic is idempotent, supporting safe receipt of duplicate events in multi-replica setups. -本文件的格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/), -并且本项目遵循 [语义化版本 (Semantic Versioning)](https://semver.org/lang/zh-CN/spec/v2.0.0.html)。 - ## [1.3.2] - 2026-01-17 -### 新增 -- **群聊搜索功能**: 在绑定群聊时新增了实时搜索功能,解决了群聊过多时难以查找的问题。 - - **后端支持**: `GET /groups` 接口现在支持 `q` 查询参数进行模糊搜索,并提高了默认返回数量。 - - **搜索前端**: 引入了带防抖逻辑的搜索输入框和自定义下拉列表,提升了用户体验。 +### Added +- **Group Chat Search**: Added real-time search functionality when binding group chats, solving the difficulty of finding specific groups when many are present. + - **Backend Support**: `GET /groups` now supports `q` query parameter for fuzzy search and increased default return limit. + - **Search Frontend**: Introduced a search input with debounce logic and a custom dropdown list for better UX. -### 变更 -- **UI 优化**: 改进了 `GroupBindingsModal` 的视觉设计,使用了更现代的列表样式、状态图标和加载动画。 -- **文档优化**: 将 `README.md` 拆分为英文版 (`README.md`) 和中文版 (`README.zh-CN.md`),以更好地支持国际化。 +### Changed +- **UI Optimization**: Improved `GroupBindingsModal` visual design with a modern list style, status icons, and loading animations. +- **Documentation**: Split `README.md` into English (`README.md`) and Chinese (`README.zh-CN.md`) for better internationalization support. ## [1.3.1] - 2026-01-16 -### 新增 -- **群聊绑定管理**: 增强了 Topic 与飞书群聊绑定的安全性与流程。 - - **权限控制**: 仅 Topic 创建者或管理员允许执行群聊绑定/解绑操作。 - - **审批流程**: 新增群聊绑定审批机制,非管理员/非信任用户的绑定请求需经过审批(`status` 追踪)。 - - **管理员通知**: 引入 `admin-notifier.ts`,当有新的 Topic 或群聊绑定请求时,通过飞书卡片实时通知管理员。 -- **信任用户系统**: 引入 `isTrusted` 标志。 - - 信任用户创建 Topic 或绑定群聊时将自动通过审批。 - - 管理员由于其特殊权限,默认享受自动审批。 +### Added +- **Group Chat Binding Management**: Enhanced security and workflow for binding Topics to Feishu group chats. + - **Permission Control**: Only Topic creators or Admins are allowed to bind/unbind groups. + - **Approval Workflow**: New approval mechanism for group binding requests from non-admin/non-trusted users (tracked via `status`). + - **Admin Notifications**: Introduced `admin-notifier.ts` for real-time Feishu card notifications to admins upon new Topic or Binding requests. +- **Trusted User System**: Introduced `isTrusted` flag. + - Trusted users' Topic and Binding requests are auto-approved. + - Admins skip approval by default. -### 变更 -- **数据库架构**: `topic_group_chats` 表新增了 `status` 和 `created_by` 字段,以支持审批流和权限校验。 +### Changed +- **Database Schema**: Added `status` and `created_by` fields to `topic_group_chats` table to support approval flow and permission checks. +## [1.3.0] - 2026-01-16 -### 新增 -- **视觉品牌**: 引入了自定义图标和 Favicon。 - - 为 "Alert Message Center" 专门设计的现代 Indigo 主题 Logo。 - - 将 Logo 集成到登录界面和顶部导航栏,替换了通用的 Activity 图标。 +### Added +- **Visual Branding**: Introduced custom logo and favicon. + - Modern Indigo theme logo designed specifically for "Alert Message Center". + - Integrated logo into Login screen and Header, replacing generic icons. -### 修复 -- **部署可靠性**: 修复了 Docker 环境下数据库迁移失败的问题。 - - 在 `.gitignore` 中移除了对 `apps/server/drizzle/meta` 的忽略,确保 Drizzle 迁移日志 (`_journal.json`) 能正确打包进 Docker 镜像。 +### Fixed +- **Deployment Reliability**: Fixed database migration failures in Docker environments by including `apps/server/drizzle/meta` in the package (un-ignored in git). ## [1.2.7] - 2026-01-15 -### 修复 -- **数据库迁移**:修复了在 K8s 环境下执行 `db:migrate:deploy` 时由于相对路径解析失败导致的迁移中断问题。现在使用绝对路径进行稳健解析,并增加了调试日志。 +### Fixed +- **Database Migration**: Fixed migration interruptions in K8s environments caused by relative path resolution failures. Now uses robust absolute paths with additional debug logging. ## [1.2.6] - 2026-01-15 -### 变更 -- **用户 Token**:将用户的 `personalToken` 从 32 位 UUID 缩短为 8 位十六进制字符串,提升易用性。 -- **数据库迁移**:完善了数据库迁移流程,在 `db:migrate:deploy` 中集成了存量用户 Token 的自动缩短逻辑,确保线上环境数据的一致性。 -- **AI 规范**:更新了 `copilot-context.md`,明确要求 AI 在每次修改代码后必须进行代码风格和 Lint 检查。 - +### Changed +- **User Tokens**: Shortened `personalToken` from 32-char UUID to 8-character hex string for better usability. +- **Database Migration**: Integrated automated migration for existing user tokens into the deployment script. +- **AI Conventions**: Updated `copilot-context.md` with strict requirements for style and lint checks. + ## [1.2.5] - 2026-01-15 -### 修复 -- **前端鲁棒性**: 修复了当数据库为空或 API 返回错误对象时页面发生崩溃(白屏)的问题。 - - 为 `TopicsView`, `SystemLoadView` 和 `AdminView` 中的所有 API 请求增加了 `res.ok` 和 `Array.isArray` 校验。 - - 增加了防御性逻辑,确保在数据未加载或加载失败时显示友好的提示而非崩溃。 -- **Vite 环境变量**: 修复了 `TypeError: Cannot read properties of undefined (reading 'VITE_WEBHOOK_BASE_URL')`。 - - 在 `TopicsView.tsx` 中使用可选链 (`meta.env?.`) 安全地访问 Vite 环境变量,防止由于环境未完全初始化导致的崩溃。 -- **CI & 类型安全**: 修复了破坏 CI 流水的类型错误与格式问题。 - - 运行 `biome check --write` 统一了全局代码格式。 - - 完善了 `feishu.ts` 中的 `UserAccessTokenData` 接口定义,补充了飞书 API 返回的用户基础信息字段。 - - 在 `auth.ts` 中增加了对 `feishuClient.getUserAccessToken` 返回值的空值校验,确保 OAuth 回调流程更健壮。 +### Fixed +- **Frontend Resilience**: Fixed "white page" crashes when database is empty or API returns error objects. + - Added `res.ok` and `Array.isArray` checks to all API requests in `TopicsView`, `SystemLoadView`, and `AdminView`. + - Added defensive logic to show friendly messages instead of crashing. +- **Vite Env Variables**: Fixed `TypeError` when accessing environment variables. + - Used optional chaining (`meta.env?.`) for safe access. +- **CI & Type Safety**: Fixed CI-breaking type errors and formatting issues. + - Unified code style via `biome check --write`. + - Improved `UserAccessTokenData` interface and added null checks for OAuth callback. ## [1.2.4] - 2026-01-15 -### 变更 -- **类型安全**: 全面重构了服务端与前端的代码,消除了绝大部分 `any` 类型的使用。 - - 在 `webhook.ts`, `verify_permissions.ts`, `feishu.ts` 等核心文件中引入了显式接口。 - - 改进了 Webhook Body 的处理逻辑,在保持灵活性的同时增强了类型校验。 - - 修复了多处 Non-null Assertion 为更安全的可选链或显式空值检查。 -- **Linting**: 严格执行 Biome 的 `noExplicitAny` 规则。 +### Changed +- **Type Safety**: Refactored core logic to eliminate `any` types. + - Introduced explicit interfaces in `webhook.ts`, `verify_permissions.ts`, and `feishu.ts`. + - Improved Webhook body handling with better validation. +- **Linting**: Enforced Biome's `noExplicitAny` rule. ## [1.2.3] - 2026-01-15 -### 新增 -- **自动化数据库迁移**: 引入了自动化数据库初始化与迁移机制。 - - 添加了 `src/db/migrate.ts` 脚本,使用 Drizzle Migrator 自动应用挂起的迁移。 - - 更新了 `Dockerfile`,使容器启动时自动执行数据库迁移。 - - 在 `package.json` 中新增了 `db:migrate:deploy` 脚本。 +### Added +- **Automated DB Migrations**: Introduced automatic database initialization. + - Added `src/db/migrate.ts` using Drizzle Migrator. + - Updated `Dockerfile` to run migrations on startup. -### 修复 -- **初始化错误**: 修复了在全新环境下启动时因缺少数据库表导致的 `relation "users" does not exist` 错误。 -- **迁移历史**: 清理并重新生成了初始迁移文件,确保所有表在全新部署时能正确创建。 +### Fixed +- **Initialization Errors**: Fixed `relation "users" does not exist` on fresh installs. +- **Migration History**: Re-generated initial migration files for clean deployments. -## [1.2.2] - 2026-01-14 +## [1.2.2] - 2024-01-14 -### 变更 -- **Linting**: 强化了 Biome 配置,启用了更严格的 `a11y` (可访问性), `suspicious` (可疑代码), `style` (代码规范) 和 `correctness` (正确性) 检查规则。 -- **配置**: 配置 `noUnknownAtRules` 规则以忽略 Tailwind CSS 特有的 At-rules。 -- **CI/CD**: 集成 Biome 检查到 GitHub Actions 工作流,确保在所有 Pull Request 中强制执行代码规范检查。 +### Changed +- **Linting**: Tightened Biome configuration for `a11y`, `suspicious`, `style`, and `correctness`. +- **CI/CD**: Integrated Biome checks into GitHub Actions. -### 修复 -- **Web 可访问性**: 为所有按钮添加了显式的 `type="button"` 以符合规范。 -- **语义化/ARAI**: 修正了 `Modal` 背景的交互逻辑,将非语义化的 `div` 替换为 `