Skip to content

feat: [M030-M032] 迁移订阅增删、通知查询和已读状态 - #231

Merged
makewheels merged 2 commits into
masterfrom
feat-migration-interactions-20261030
Oct 30, 2026
Merged

makewheels merged 2 commits into
masterfrom
feat-migration-interactions-20261030

Conversation

@makewheels

@makewheels makewheels commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

范围与成果

归属S15,基线master 1b4eeb20257ca3b84c8dec85ab5b03aac3e4c3fb。本批只做三个固定任务,共享旧契约设施/统一装配,不迁库、不切生产、不创建云资源,合并由所有者决定。

任务 交付 隔离开关
M030 subscribe / unsubscribe,原记录与独立频道计数、直接错误和部分失败 subscription_writes
M031 getMyNotifications / getUnreadCount,旧分页/类型/日期和身份 notification_reads
M032 markAsRead / markAllAsRead,旧JSON绑定、所有者和read窄写 notification_writes

三个开关默认关闭;共用现有RequestCycle与同步日志,默认404且不访问数据库,原FC/ASGI入口不变。业务/端口不依赖框架或Mongo/云SDK,不新增生产索引、后台线程、重试或队列。

调查纠正:通知四路由旧版未安装CheckToken,缺失/坏token仍按null身份处理,不在迁移中新增鉴权。频道计数是Long,不能新增int上限;通知缺失read为false、显式null映射失败,未读与全部已读只匹配BSON false。sendNotification无生产调用者,不凭声明新增“订阅自动通知”。

剩余清单固定M001–M090,列交付物、验收、实际前置和状态,不再扩字母子号。本批三项隔离交付,基线剩余87项;此数量不是整个项目的工作量百分比。真实FC/各端留给M040,云权限/可靠任务等独立阻塞不隐藏。

本次实际验证

  • Java:JDK21.0.10、独享回环Mongo8.3.7,mvn -o -B -ntp -pl video -Pspringboot "-Dtest=InteractionHttpContractTest,SubscriptionReadHttpContractTest,NotificationServiceTest" test,显式覆盖Mongo URI/host/port/database,16passed / 0skipped,Checkstyle通过。
  • 最终86组真实旧MVC HTTP/完整前后BSON(订阅32、通知读26、通知写28),生成后撤掉生成参数,从固定文件再次全文重放通过。合成数据,外部媒体/网络服务无调用。
  • Python新增102项;CPython3.12.12相关9文件首轮307passed/2failed。两项为测试误选含null的列表夹具,修正后定向2passed。终审核对固定Spring字节码,新增控制字符/NBSP两组真实旧样本,修复前实际2failed;抽取现有HLS纯Java trim原样共用后,通知/HLS/架构最终121passed / 0skipped / 1既有Starlette/httpx warning。批次有重叠不相加,不称本机全量。
  • 另验真实唯一索引冲突、计数失败不重放且保留前序写入、读写回环/重复标记、find先于count、未知字段、HEAD/OPTIONS及默认关闭无DB访问。
  • Ruff、架构、500行和Git whitespace门禁通过;固定90个编号唯一、依赖存在且无环,状态汇总及已改文档本地链接检查通过。

终版提交73422ddebcfa7d427c09460dba88a7f90c1f5882的完整CI已完成:12项成功 / 2项E2E跳过,不是旧master或上一版提交的绿灯。

  • Linux Python全量:1531passed / 0skipped / 1warning,Ruff通过。
  • Java全量:783项,0失败 / 0错误 / 0跳过;新HTTP契约类4项/86组也在此通过。
  • Linux来源与可重现构建通过;代码质量、前端、Android/iOS单测、Worker、CLI、AI Agent及汇总门禁成功。
  • API E2E与浏览器E2E两项为skipped,不计作已跑;iOS/Android CI单测也不等于真实设备验收。

未验、回退与接续

真实FC/网络/冷热、API/浏览器E2E、Web/移动端实机及生产切流未在本机跑,不能用单测代替。既有用例覆盖和本次实际跑通已分别记入verification/progress。

回退本PR全部代码改动(含功能提交和共享trim兼容修正)即可移除新隔离能力,已有赞踩/订阅读取基线不动;没有生产数据/配置变更,不恢复旧库备份覆盖业务数据,无新增在途任务。独享临时Mongo已停止并确认端口关闭,临时Mongo数据/虚拟环境/缓存已清理。

后续优先M016/M017可靠任务证据和M027 LOCAL扫描,不扩大本批三个任务。单项有效工时未独立采集,不按共享调查或测试数编造工期。

文档:overview/remaining-work.md、user/subscription-notifications.md、progress.md、verification.md及API/业务/CHANGELOG已同步。官方依据沿用overview/official-guidance.md,行为以现役Java源码/真实契约而不是框架推测为准。

Preserve legacy HTTP, optional notification identity, full BSON mapping,
independent subscription counters and narrow read-state writes behind
three default-off capability switches. Keep production entrypoints unchanged.

Pin 84 real Java HTTP/BSON cases and add 100 Python tests. Verify 16 Java
tests and 309 related Python tests across the focused run and two corrected
fixture retests, plus Ruff, architecture and repository quality gates.

Replace the expanding remainder hierarchy with 90 fixed deliverables,
explicit prerequisites and acceptance evidence. Record the three isolated
deliveries separately from unperformed FC/device validation and cutover.
Two additional real legacy MVC/BSON fixtures fail against Unicode strip:
Java trims control characters but retains NBSP. Reuse the existing HLS
Java trim implementation through a pure shared helper instead of adding
a different notification conversion rule.

Replay all 86 pinned legacy fixtures and 16 Java tests. Verify 121 focused
notification, HLS and architecture tests after observing both new cases
fail before the fix. Update evidence to distinguish test batches from
full current-head CI and retain the same three-task delivery scope.
@makewheels
makewheels merged commit dec7a77 into master Oct 30, 2026
14 checks passed
@makewheels
makewheels deleted the feat-migration-interactions-20261030 branch October 30, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant