复验(KEEP-VERIFY)在既有 Phase 08 实现中发现 3 处真实缺陷并修复:
D1(严重)DiscoverService.searchUsers 不含查看者身份,查询条件既无排除自己也无任何 Block 条件,被拉黑者仍可被搜到并点开 —— INV-004「搜索不可见」整体失效。改为接收 viewerUserId,排除自己,并用新增的 UserRelationMapper.findBlockedUserIdsBothWays(UNION 双向)一次取回后 notIn 批量排除,避免 N+1。
D2 详情路径(DiscoverService / UserProfileService)均无 Block 判断,知道 userId 即可读到被拉黑者资料。两条路径统一加双向判断并返回 null,由 Controller 转 404(不用「已隐藏」以免被用来探测存在);UserProfileService 中该判断排在隐私设置之前,拉黑不能被对方「允许搜索可见」覆盖。
D3(潜伏,仅 PostgreSQL 暴露)RelationshipService.like() 把关系类型值 "liked" 当 match source 写入 matches.source,违反 V003:91 的 chk_match_source。测试库 schema-h2.sql 该列是裸 VARCHAR(32)、无约束,故长期静默通过。改传 MATCH_SOURCE_USER_LIKE。canonical 路径 RelationService.like 传值本就正确,线上未触发。
测试保真度对齐:schema-h2.sql 补 chk_match_source(与 V003 逐字对齐)与 user_profiles 表(此前测试库无此表,资料查询无法端到端测试)。
新增 DiscoverBlockInvisibilityIntegrationTest(9 用例,@SpringBootTest 真实 H2 + 真实 SQL),覆盖正向/反向拉黑、对称性、排除自己、详情 404 与查自己不受限。P0FixVerificationTest 补 source 回归守卫。DiscoverServiceTest 同步构造签名。
负向验证:临时还原 D3 修复后,4 个用例因 CHK_MATCH_SOURCE 约束违反报错,证明守卫有效。
证据:后端全量 308 tests / 0 failures / 0 errors / 3 skipped(基线 299);UI 契约 13/13 GREEN。报告 docs/Phase-08-V11-Recovery-Completion-Report-2026-09-16.md。
同步 STATUS.md / JIRA_BACKLOG.md(EPIC-P08-V11 置 ✅)/ 客户需求基线计划 Phase 08 复选框;首轮报告加状态注记(其「Known Issues 无」已被推翻)。.gitignore 忽略 .workbuddy/。
62 lines
823 B
Plaintext
62 lines
823 B
Plaintext
# Dependencies
|
|
node_modules/
|
|
backend/local-maven/
|
|
backend/build-temp/
|
|
backend/.m2/
|
|
__pycache__/
|
|
*.py[cod]
|
|
*.lock
|
|
package-lock.json
|
|
yarn.lock
|
|
pnpm-lock.yaml
|
|
|
|
# Build outputs
|
|
backend/target/
|
|
admin-web/dist/
|
|
miniapp/dist/
|
|
miniapp/unpackage/
|
|
|
|
# IDE
|
|
.idea/
|
|
.vscode/
|
|
*.iml
|
|
*.iws
|
|
*.ipr
|
|
.DS_Store
|
|
|
|
# Environment variables with secrets
|
|
backend/src/main/resources/application-dev.yml
|
|
*.env
|
|
!.env.example
|
|
|
|
# Logs
|
|
*.log
|
|
logs/
|
|
|
|
# Test data
|
|
.pytest_cache/
|
|
tests/fixtures/*.csv
|
|
tests/fixtures/*.json
|
|
|
|
# Local workspace and developer settings
|
|
.worktrees/
|
|
.zcode/
|
|
.workbuddy/
|
|
project.private.config.json
|
|
/nul
|
|
/infrastructure/nul
|
|
|
|
# OS files
|
|
Thumbs.db
|
|
.DS_Store
|
|
|
|
# Secrets and certificates
|
|
docker-compose.prod.yml
|
|
infrastructure/secrets/
|
|
infrastructure/certs/
|
|
infrastructure/backups/
|
|
|
|
# Local artifacts and backups
|
|
artifacts/backups/
|
|
*.dump
|