mirror of
https://github.com/Silentely/eSIM-Tools.git
synced 2026-09-03 06:24:20 +08:00
* ✨ feat(sentry): 添加用户反馈功能 - 升级 CDN bundle 以支持 feedback 模块 - 添加 feedbackIntegration 内置 Widget(主动反馈) - 实现错误后自动弹窗(Crash-Report Modal) - 添加冷却机制防止频繁弹窗(60秒冷却 + 同一错误不重复) * ♻️ refactor(sentry): 修复审查发现的问题 - 消除指纹计算重复(DRY 违反) - 统一使用 const/let 替代 var - 复用已有 showReportDialog 函数 - 添加 beforeSend UI 副作用设计说明注释 * 🐛 fix(sentry): 修复 SentryMock 缺失方法 - 添加 feedbackIntegration 和 replayIntegration 到 SentryMock - 修复 CDN 加载失败时 TypeError - 删除多余空行 * 🐛 fix(sentry): 修复代码质量问题 - sentry-loader.js 添加 replayIntegration 和 feedbackIntegration 配置 - sentry-loader.js 添加错误后自动弹窗逻辑(冷却机制 + try-catch) - sentry-init.js 添加 showReportDialog try-catch 保护 - 弹窗延迟从 100ms 改为 500ms(弱网兼容) * ✨ feat(sentry): 修复所有代码质量问题 - H1: CSP 添加 *.sentry.io 到 script-src(4 个文件) - M1: Feedback Widget 和自动弹窗添加中文文案 - M2: 同步两套初始化路径配置(tracing、脱敏、ignoreErrors) - M3: sentry-entry.js 添加 feedbackIntegration 导出 - M4: 新增专项测试(13 个测试用例) - L1: SentryMock 补齐 showReportDialog/lastEventId - L2: 空事件对象防御 * ✨ feat(sentry): 修复 PR 审查发现的全部问题 功能正确性: - query_string 添加类型检查(字符串/对象兼容) - 指纹计算移到脱敏前(避免不同错误被误判为重复) - 冷却状态更新移到 setTimeout 内部(避免空转) - subtitleLine2 改为 subtitle2(修正字段名) CSP 修复: - script-src 移除 *.sentry.io(减少攻击面) - frame-src 添加 *.sentry.io(支持弹窗 iframe) - 添加 worker-src/child-src blob:(支持 Session Replay) - server.js helmet CSP 同步更新 - netlify.toml 注释与实际策略对齐 配置/架构: - sentry-entry.js 添加 lastEventId 导出 - tracePropagationTargets 添加 CORS 风险注释 - CDN 架构添加说明注释 代码质量: - URL 参数脱敏支持大小写不敏感 - 移除过宽的 ignoreErrors 规则 - 测试文件添加 use strict - 添加 i18n 和漂移风险注释 * fix: apply CodeRabbit auto-fixes (#85) Fixed 3 file(s) based on 5 unresolved review comments. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai> * ✨ feat(sentry): 修复新一轮审查意见 CSP 修复: - script-src 恢复 *.sentry.io(showReportDialog 需要) - netlify.toml Header CSP 同步 Cloudflare/Google - server.js helmet CSP 同步 冷却竞态修复: - 状态预留移到 setTimeout 之前(防止 500ms 内重复弹窗) - 弹窗失败时回滚冷却状态 脱敏修复: - query_string 对象分支改为大小写不敏感 - sanitizeQueryString 迭代改为安全模式(先收集键再遍历) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai>