fix: 处理 PR 审查意见(竞态/类型安全/冗余/日志泄露)

- App.vue fetchAppFromStore 的 fetch 接入 rootAbortController.signal,
  组件卸载时取消请求,避免竞态与内存泄漏;catch 静默处理 AbortError。
- App.vue loadHome 远程字段由 `as string` 断言改为 typeof 运行时守卫,
  避免非字符串数据注入响应式状态(非崩溃,属改进)。
- ranking.ts topUpdatedContributors 移除对 topByUpdate 已过滤结果的冗余 filter。
- storeConfig 加载成功日志改为仅打印规则条数,避免完整配置泄露且保留诊断价值。
- 未采纳:parseAppPayload 默认 origin=spark 维持不变(spark 为历史默认源,
  盲改 apm 有反向误路由风险,且该字符串分支仅为极旧格式兜底)。
This commit is contained in:
xiyidaiwa
2026-08-10 17:19:55 +08:00
parent 9247fe8e63
commit 800a92b419
3 changed files with 41 additions and 12 deletions
+2 -3
View File
@@ -83,8 +83,7 @@ export function topUpdatedContributors(
recentN: number = RECENT_UPDATE_WINDOW,
topN: number = TOP_N,
): ContributorRank[] {
const recent = topByUpdate(apps, origin, recentN).filter(
(a) => a.origin === origin,
);
// topByUpdate 内部已按 origin 过滤,无需再次 filter
const recent = topByUpdate(apps, origin, recentN);
return toRanks(countContributors(recent), topN);
}