Files
im_server/docs/test/IM-system租户接口冒烟记录-20260916.md
T

126 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IM system 租户接口冒烟记录 - 2026-09-16
## 环境
- Base URL: `https://api-test.118im.com`
- Tenant Code: `system`
- API Key: 新测试环境 Key,接口解析返回的 WebSocket 地址可用
- 测试账号: 本次临时注册 `s832453991` / `17832453991`
- 测试时间: `2026-09-16 11:40 CST`
## 结论
`system` 租户登录、注册、WebSocket 登录和大部分登录后接口可用;本轮确认 1 个确定后端问题:
`GET /v1/im/me/privacy` 在 `system` 租户下返回 `500 INTERNAL_ERROR`。该问题已在 `2026-09-16 12:27 CST` 通过补齐 `meeting_im.im_user_privacy_settings.group_invite_verification` 字段修复,复测返回 200。
初步根因是 `system` 租户实际业务库 `meeting_im` 的 `im_user_privacy_settings` 表缺少 `group_invite_verification` 字段,而当前代码查询和更新都会使用该字段。
## 确认通过
| 接口 | 结果 |
| --- | --- |
| `POST /v1/im/tenants/resolve` | 200,返回 `tenant.code=system` |
| `POST /v1/im/auth/verification-codes` | 200 |
| `POST /v1/im/auth/verification-codes/{challenge_id}/verify` | 200,固定验证码 `123456` 可用 |
| WebSocket `hi` | 201 |
| WebSocket `acc user:new` | 200,新账号创建成功 |
| WebSocket `login scheme=token` | 200 |
| WebSocket `sub me` | 200 |
| `GET /v1/im/bootstrap` | 200 |
| `GET /v1/im/me` | 200 |
| `GET /v1/im/me/profile` | 200 |
| `GET /v1/im/security/realname` | 200 |
| `GET /v1/im/workbench` | 200,返回 `enterprise.tenant_code=system` |
| `GET /v1/im/organization/departments` | 200 |
| `GET /v1/im/organization/members?limit=20` | 200 |
| `GET /v1/im/organization/search?q=1&limit=20` | 200 |
| `GET /v1/im/attendance/config` | 200 |
| `GET /v1/im/attendance/records?limit=20` | 200 |
| `GET /v1/im/meeting-notes?limit=20` | 200 |
| `GET /v1/im/meetings?limit=20` | 200 |
| `GET /v1/im/reports/abuse/reasons?target_type=user` | 200 |
| `GET /v1/im/reports/abuse/reasons?target_type=group` | 200 |
| `GET /v1/im/reports/daily/statistics?date=2026-09-16` | 200 |
| `GET /v1/im/reports/daily?limit=20` | 200 |
| `GET /v1/im/reports/monthly/statistics?month=2026-09` | 200 |
| `GET /v1/im/reports/monthly?limit=20` | 200 |
| `GET /v1/im/executive-mailbox/config` | 200 |
| `GET /v1/im/feedback/config` | 200 |
| `GET /v1/im/app/releases/latest?platform=ios&current_version=1.0.0&channel=stable` | 200 |
| `GET /v1/im/search/conversations?q=&limit=20` | 200 |
| `GET /v1/im/forward-targets?q=&limit=20` | 200 |
| `GET /v1/im/system-notifications?limit=20` | 200 |
| `GET /v1/im/favorites?limit=20` | 200 |
| `GET /v1/im/groups?limit=20` | 200 |
| `GET /v1/im/calls?limit=20` | 200 |
## 问题记录
### P0: `GET /v1/im/me/privacy` 返回 500
请求:
```http
GET /v1/im/me/privacy
X-Tenant-Code: system
X-IM-Schema: 1
Authorization: Bearer <system 用户 token>
```
响应:
```json
{
"code": 90000,
"reason": "INTERNAL_ERROR",
"message": "internal error"
}
```
数据库检查:
- `hotgo.im_tenant` 中 `system` 租户:`db_name=meeting_im`,`db_dsn=''`。
- `meeting_im.im_user_privacy_settings` 当前字段包含:
- `id`
- `user_id`
- `add_me_methods`
- `profile_visibility`
- `last_seen_visibility`
- `read_receipts`
- `version`
- `created_at`
- `updated_at`
- `tinode.im_user_privacy_settings` 比 `meeting_im` 多一个字段:
- `group_invite_verification`
代码使用点:
- `/Users/youshunlai/go_workspace/im_server/server/db/mysql/tenant_adapter.go:6613`
- `/Users/youshunlai/go_workspace/im_server/server/db/mysql/tenant_adapter.go:7194`
判断:
`system` 租户库 `meeting_im` 未执行最新隐私设置表结构迁移。当前代码查询 `group_invite_verification` 字段时会在该库报 SQL 错误,最终 HTTP 统一包装成 `500 INTERNAL_ERROR`。
处理结果:
- 测试库 `mysql.118im.com:30306/tinode` 已有该字段。
- 测试库 `mysql.118im.com:30306/meeting_im` 已补字段。
- 本地库 `127.0.0.1:3306/tinode` 已补字段。
- 本地库 `127.0.0.1:3306/meeting_im` 已补字段。
- 复测 `GET /v1/im/me/privacy` 返回 200,响应包含 `group_invite_verification:false`。
## 误测排除
以下接口第一次测试时返回 400/405,是因为请求参数或方法不完整,不属于本轮确认问题:
- `GET /v1/im/reports/abuse/reasons`:需要 `target_type=user|group`。
- `GET /v1/im/reports/daily/statistics`:需要 `date=YYYY-MM-DD`。
- `GET /v1/im/reports/monthly/statistics`:需要 `month=YYYY-MM`。
- `GET /v1/im/reports/daily/reminders`:实现为 `POST`,GET 返回 405 属正常方法限制。
## 额外注意
旧 API Key 访问 `system` 或 `default` 都返回 `403 API_KEY_REQUIRED`;新测试环境应使用租户解析接口返回的新 Key 和 WebSocket 地址。