Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions docs/项目问题复查报告-2026-09-18.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# BITerStore 项目问题复查报告

复查日期:2026-09-18(UTC+8)

复查依据:`项目交接文档.md`、`项目现状复查与问题清单-2026-09-17.md`、`问题修复记录-2026-09-18.md`、`部署验收记录-2026-09-18.md`、`TODO.md` 以及当前工作区代码。

## 结论

当前代码已经覆盖交接文档中 C01–C09 的主要修复,H5 和微信小程序的本地 lint、类型检查及测试均通过。本次用户反馈的“审核通过通知堆叠”也已定位并修复:消息首页不再逐条渲染审核通知,而是按四个通知分类聚合;分类详情仍保留完整通知明细。

项目暂不建议仅凭本地测试视为全部完成。剩余风险主要集中在真实账号/真机联调、并发与恢复演练、CI 首次运行、R2 运维配置和微信平台发布验收。

## 本次发现与处理

| 编号 | 问题 | 当前状态 | 影响 |
| --- | --- | --- | --- |
| N01 | 消息首页逐条展示系统通知,多个商品审核后卡片大量堆叠 | 已修复 | 首页现在按“赞与收藏、评论与回复、系统通知、新的关注”聚合,并合并未读数量;详情页仍显示每条通知 |
| N02 | 真实私有媒体成功读取尚未完成真机联调 | 待验证 | 未登录 401 检查不能证明登录后的图片下载、缓存和账号切换都正常 |
| N03 | 真实 R2 并发上传、取消、重复完成请求尚未在生产凭据下验证 | 待验证 | 上传高并发或网络中断时仍需要确认幂等、清理和最终对象一致性 |
| N04 | 已读游标并发保护缺少真实 PostgreSQL 压力验证 | 待验证 | 低序号请求与高序号请求并发时,需要确认不会回退阅读进度 |

## 交接文档中仍未闭环的事项

### P0:上线前必须完成

1. 合并 PR 并完成合并后的生产门禁和回归验收。
2. 为本地到 R2 的备份失败增加独立监控、告警和责任人。
3. 在隔离环境完成 PostgreSQL、R2、BIT-Login SQLite 和生产配置的恢复演练,并保留可审计记录。
4. 完成真实微信设备登录、授权、扫码、上传、发布、聊天和返回栈验收;目前只完成开发者工具或模拟器链路,未执行上传、提审或发布。

### P1:近期运营前完成

1. 配置并验证 Cloudflare WAF、Bot 防护、公开列表限流和异常流量告警。
2. 配置 R2 `pending/` 生命周期清理、异地灾备和恢复责任边界。
3. 建立 readiness、延迟、Redis/数据库连接、磁盘容量和备份失败监控。
4. 验证动态上游解析、CSP/favicon 提示以及 Nginx 重建后的自动恢复能力。
5. 完成首次 GitHub Actions 执行和分支保护必需检查;当前不能把本地或服务器隔离环境结果等同于 GitHub CI 已通过。

### P2:功能和体验补齐

1. 完成商品治理第二阶段:退回修改、重新提交、审核轮次和完整商品生命周期时间线。
2. 完成真实私有图片上传、下载、下架、封禁、退出和切换账号场景的真机验证。
3. 复核 Cookie transport 的跨站域名和 CSRF 策略。
4. 统计 Open Library 中文教材覆盖率,决定是否增加备用书目源或本地识别兜底。
5. 评估 Taro/Webpack 传递依赖 advisory,保持当前锁定版本,禁止用 `npm audit fix --force` 绕过兼容性约束。
6. 补齐聊天图片消息和商品链接分享等仍显示“暂未开放”的功能,或在产品范围中明确排除。

## 已完成但需要区分“代码修复”和“外部验收”的事项

- C01–C09 已有代码修复和回归测试记录,包括商品复审、上传一致性、恢复脚本、默认昵称、旧会话、私有媒体、已读游标、禁言会话和启动入口。
- 公开商品、媒体状态过滤、认证失效、刷新令牌竞争、管理员 TOTP 限流、举报幂等、上传魔数校验和安全响应头已有代码或隔离环境验证。
- 上述结果不能替代真实 R2、真实账号、真实微信设备、生产压力和灾备恢复验证。

## 本轮本地验证

在现有 Node 22.13.1 环境中执行:

- Web lint:通过
- Web 测试:48 项通过
- MiniProgram lint:通过
- MiniProgram typecheck:通过
- MiniProgram 测试:52 项通过
- `git diff --check`:通过(工作区另有交接文档历史改动和 `Assets/generated/` 未跟随本次功能修改)

## 建议执行顺序

1. 先在测试账号验证本次消息首页四类聚合和详情已读状态。
2. 再完成真实媒体、审核并发、已读并发和 R2 上传取消场景。
3. 随后处理备份恢复、监控告警、Cloudflare 和 GitHub Actions 门禁。
4. 最后进行微信真机验收,再决定是否提审或发布。

## 本次执行记录(18:48–18:49)

- Server:28 个测试文件、178 项测试通过;生产构建通过。
- Web:生产构建通过。
- MiniProgram:H5 构建通过,产物入口约 378 KiB;构建过程只有 Webpack 缓存序列化提示,没有编译错误。
- 仍未执行:真实 R2/生产账号并发验证、PostgreSQL 压力验证、微信真机授权与私有图片验证、GitHub Actions 线上运行、生产发布或提审。
12 changes: 11 additions & 1 deletion miniProgram/src/pages/messages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@ import { navigationAdapter } from '@/platform'

const noticeGlyphs: Record<Notification['type'], GlyphName> = { like: 'heart', comment: 'message', system: 'bell', follow: 'user' }

function summarizeNotifications(items: Notification[]): Notification[] {
const labels: Record<Notification['type'], [string, string]> = { like: ['赞与收藏', '暂无新的赞与收藏'], comment: ['评论与回复', '暂无新的评论与回复'], system: ['系统通知', '暂无新的系统通知'], follow: ['新的关注', '暂无新的关注'] }
return (['like', 'comment', 'system', 'follow'] as const).map((type) => {
const group = items.filter((item) => item.type === type)
const latest = group[0]
return { id: `summary-${type}`, type, title: labels[type][0], subtitle: latest?.subtitle || labels[type][1], unread: group.reduce((total, item) => total + item.unread, 0), createdAt: latest?.createdAt }
})
}

export default function MessagesPage() {
const [threads, setThreads] = useState<ChatThread[]>(() => demoRepository.peekThreads() || [])
const [notices, setNotices] = useState<Notification[]>(() => demoRepository.peekNotifications() || [])
const [nextCursor, setNextCursor] = useState<string | null>(null)
const [loadingMore, setLoadingMore] = useState(false)
const load = useCallback(() => { void demoRepository.listThreadsPage().then((page) => { setThreads((current) => preserveSnapshot(current, page.items)); setNextCursor(page.nextCursor) }); void demoRepository.listNotifications().then((next) => setNotices((current) => preserveSnapshot(current, next))) }, [])
useDidShow(() => { void requireAccount('登录后才能查看消息').then((allowed) => { if (allowed) return load() }) })
const summaries = summarizeNotifications(notices)
return <AppShell title='消息' active='messages' className='messages-page'>
<View className='notification-grid'>{notices.map((notice) => <Button id={`e2e-notification-${notice.type}`} key={notice.id} onClick={() => navigationAdapter.go(`/pages/notification/detail?type=${notice.type}`)}><View className={`notice-icon ${notice.type}`}><Glyph name={noticeGlyphs[notice.type]} /></View><View className='notice-copy'><Text className='notice-title'>{notice.title}</Text><Text className='notice-subtitle'>{notice.subtitle}</Text><Text className='notice-link'>点击查看详情</Text></View><Glyph name='chevron' className='notice-chevron' />{notice.unread > 0 && <Text className='notice-count'>{notice.unread}</Text>}</Button>)}</View>
<View className='notification-grid'>{summaries.map((notice) => <Button id={`e2e-notification-${notice.type}`} key={notice.id} onClick={() => navigationAdapter.go(`/pages/notification/detail?type=${notice.type}`)}><View className={`notice-icon ${notice.type}`}><Glyph name={noticeGlyphs[notice.type]} /></View><View className='notice-copy'><Text className='notice-title'>{notice.title}</Text><Text className='notice-subtitle'>{notice.subtitle}</Text><Text className='notice-link'>点击查看详情</Text></View><Glyph name='chevron' className='notice-chevron' />{notice.unread > 0 && <Text className='notice-count'>{notice.unread}</Text>}</Button>)}</View>
<View className='section-title message-title'><Text className='section-heading-text'>私聊消息</Text><Text className='all-read'>✓ 站内消息</Text></View>
<View className='thread-list'>{threads.map((thread) => { const user = thread.participant || getUser(thread.participantId); const last = thread.messages.at(-1); const campus = user.campus === '未设置' ? '校区未设置' : `${user.campus}校区`; return <Button id={`e2e-thread-${thread.id}`} key={thread.id} onClick={() => navigationAdapter.go(`/pages/chat/index?id=${thread.id}`)}><Avatar user={user} size={54} /><View className='thread-copy'><Text className='thread-name'>{user.name}<Text className='thread-campus'>{campus}</Text></Text><Text className={`thread-message ${thread.unread > 0 ? 'unread-preview' : ''}`}>{thread.unread > 0 ? '新消息 · ' : ''}{thread.blocked ? '[已拉黑] ' : ''}{last?.text || (thread.listing ? `我想咨询《${thread.listing.title}》` : '从一本书开始聊聊吧')}</Text></View><Text className='thread-time'>{formatThreadTime(thread.updatedAt)}</Text>{thread.unread > 0 && <Text className='thread-unread'>{thread.unread}</Text>}</Button> })}</View>
{nextCursor && <Button className='secondary-button catalog-load-more' disabled={loadingMore} onClick={async () => { if (loadingMore) return; setLoadingMore(true); try { const page = await demoRepository.listThreadsPage(nextCursor); setThreads(page.items); setNextCursor(page.nextCursor) } finally { setLoadingMore(false) } }}>{loadingMore ? '正在加载…' : '加载更多会话'}</Button>}
Expand Down
12 changes: 11 additions & 1 deletion web/app/components/mobile-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,17 @@ function MessagesPage({ navigate }: { navigate: (to: string) => void }) {
const [threads, setThreads] = useState<ChatThread[]>(() => peekThreads() || []); const [items, setItems] = useState<Notification[]>(() => peekNotifications() || []); const [nextCursor, setNextCursor] = useState<string | null>(null); const [loadingMore, setLoadingMore] = useState(false);
useEffect(() => { void demoRepository.listThreadsPage().then((page) => { const next = page.items; setThreads((current) => preserveSnapshot(current, next)); setNextCursor(page.nextCursor); }).catch(() => undefined); void demoRepository.listNotifications().then((next) => setItems((current) => preserveSnapshot(current, next))).catch(() => undefined); }, []);
const loadMore = async () => { if (!nextCursor || loadingMore) return; setLoadingMore(true); try { const page = await demoRepository.listThreadsPage(nextCursor); setThreads(page.items); setNextCursor(page.nextCursor); } finally { setLoadingMore(false); } };
return <AppShell active="/messages" navigate={navigate} title="消息" className="messages-page"><div className="notification-grid">{items.map((item) => { const Icon = { like: Heart, comment: MessageCircle, system: Bell, follow: UserRound }[item.type]; return <button onClick={() => navigate(`/messages/notifications/${item.type}`)} aria-label={`查看${item.title}详情`} key={item.id}><span className={`notice-icon ${item.type}`}><Icon /></span><div><strong>{item.title}</strong><p>{item.subtitle}</p><small>点击查看详情</small></div><ChevronRight className="notice-chevron" />{item.unread > 0 && <b>{item.unread}</b>}</button>; })}</div><div className="section-title message-title"><h2>私聊消息</h2><span><Check size={14} />站内消息</span></div><div className="thread-list">{threads.map((thread) => { const user = thread.participant || getUser(thread.participantId); const last = thread.messages.at(-1); return <button onClick={() => navigate(`/messages/${thread.id}`)} key={thread.id}><Avatar user={user} size={54} /><div><h3><strong>{user.name}</strong><span>{user.campus === '未设置' ? '校区未设置' : `${user.campus}校区`}</span></h3><p className={thread.unread > 0 ? 'unread-preview' : ''}>{thread.unread > 0 ? '新消息 · ' : ''}{thread.blocked ? '[已拉黑] ' : ''}{last?.text || (thread.book ? `我想咨询《${thread.book.title}》` : '从一本书开始聊聊吧')}</p></div><time>{formatThreadTime(thread.updatedAt)}</time>{thread.unread > 0 && <b>{thread.unread}</b>}</button>; })}</div>{nextCursor && <button className="secondary-button catalog-load-more" disabled={loadingMore} onClick={() => void loadMore()}>{loadingMore ? '正在加载…' : '加载更多会话'}</button>}{threads.length === 0 && <div className="inline-state"><Image src="/assets/tobby-question.webp" alt="暂无私聊消息" width={760} height={760} /><h3>还没有私聊消息</h3><p>从一本感兴趣的书开始聊聊吧。</p></div>}<div className="tobby-banner"><Image src="/assets/tobby-hello.webp" alt="Tobby 消息提醒" width={760} height={760} /><span><strong>Tobby 提醒:</strong>及时回复消息,能提升成交率哦~</span></div></AppShell>;
const notices = summarizeNotifications(items);
return <AppShell active="/messages" navigate={navigate} title="消息" className="messages-page"><div className="notification-grid">{notices.map((item) => { const Icon = { like: Heart, comment: MessageCircle, system: Bell, follow: UserRound }[item.type]; return <button onClick={() => navigate(`/messages/notifications/${item.type}`)} aria-label={`查看${item.title}详情`} key={item.id}><span className={`notice-icon ${item.type}`}><Icon /></span><div><strong>{item.title}</strong><p>{item.subtitle}</p><small>点击查看详情</small></div><ChevronRight className="notice-chevron" />{item.unread > 0 && <b>{item.unread}</b>}</button>; })}</div><div className="section-title message-title"><h2>私聊消息</h2><span><Check size={14} />站内消息</span></div><div className="thread-list">{threads.map((thread) => { const user = thread.participant || getUser(thread.participantId); const last = thread.messages.at(-1); return <button onClick={() => navigate(`/messages/${thread.id}`)} key={thread.id}><Avatar user={user} size={54} /><div><h3><strong>{user.name}</strong><span>{user.campus === '未设置' ? '校区未设置' : `${user.campus}校区`}</span></h3><p className={thread.unread > 0 ? 'unread-preview' : ''}>{thread.unread > 0 ? '新消息 · ' : ''}{thread.blocked ? '[已拉黑] ' : ''}{last?.text || (thread.book ? `我想咨询《${thread.book.title}》` : '从一本书开始聊聊吧')}</p></div><time>{formatThreadTime(thread.updatedAt)}</time>{thread.unread > 0 && <b>{thread.unread}</b>}</button>; })}</div>{nextCursor && <button className="secondary-button catalog-load-more" disabled={loadingMore} onClick={() => void loadMore()}>{loadingMore ? '正在加载…' : '加载更多会话'}</button>}{threads.length === 0 && <div className="inline-state"><Image src="/assets/tobby-question.webp" alt="暂无私聊消息" width={760} height={760} /><h3>还没有私聊消息</h3><p>从一本感兴趣的书开始聊聊吧。</p></div>}<div className="tobby-banner"><Image src="/assets/tobby-hello.webp" alt="Tobby 消息提醒" width={760} height={760} /><span><strong>Tobby 提醒:</strong>及时回复消息,能提升成交率哦~</span></div></AppShell>;
}

function summarizeNotifications(items: Notification[]): Notification[] {
const labels: Record<Notification['type'], [string, string]> = { like: ['赞与收藏', '暂无新的赞与收藏'], comment: ['评论与回复', '暂无新的评论与回复'], system: ['系统通知', '暂无新的系统通知'], follow: ['新的关注', '暂无新的关注'] };
return (['like', 'comment', 'system', 'follow'] as const).map((type) => {
const group = items.filter((item) => item.type === type);
const latest = group[0];
return { id: `summary-${type}`, type, title: labels[type][0], subtitle: latest?.subtitle || labels[type][1], unread: group.reduce((total, item) => total + item.unread, 0), createdAt: latest?.createdAt };
});
}

function NotificationDetailPage({ type, navigate }: { type: string; navigate: (to: string) => void }) {
Expand Down
Loading