[BUG]: Comment, reply and team-join notifications link to wrong or non-existent frontend routes

未关闭 适合新手
#810 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 20 天内回复

@mithunkc017-ship-it 已经在做这个了。

开始于 2026年11月25日。

  • #815 来自 @mithunkc017-ship-it —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
80/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
full-stack

调研方向

先阅读 frontend/src/App.tsx 中的路由表,确认存在哪些路径(/community、/team-builder),以及 frontend/src/components/Header.tsx 如何调用 navigate(notification.link)。然后修复 backend/controllers/comment_controller.go 第 112 行和第 138 行附近以及 backend/controllers/team_controller.go 第 393 行附近存储的链接字符串。添加一个后端测试,断言每种通知类型对应的链接,并检查现在每条通知都落到真实路由上。完成意味着没有任何通知会导致 404 或进入错误的房间。

由索引模型根据 Issue 内容生成。

描述

Bug Description

Three of the in-app notifications created by the backend store a link that does not match any working frontend route. When the user clicks the notification in the header bell (Header.tsx → navigate(notification.link)), they end up on the wrong page, on an error toast, or on the 404 page.

Notification Created in Stored link What happens when clicked
"New Reply" (someone replied to your comment) backend/controllers/comment_controller.go L112 /debate/<transcriptId> Matches debate/:roomId → DebateRoom (the bot debate room). There is no debate state, so it shows "Debate Session Not Found" and redirects to /startDebate.
"New Comment" (someone commented on your debate/post) backend/controllers/comment_controller.go L138 /view-debate/<transcriptId> Matches view-debate/:debateID → ViewDebate, the live spectator view. It opens a debate WebSocket using the transcript ID as a live debate ID, so the user sees an empty or broken live room instead of the comment.
"New Team Member" (someone joined your team) backend/controllers/team_controller.go L393 /team/<teamId> No /team/:id route exists in frontend/src/App.tsx → NotFound (404).

Comments are only displayed in CommunityFeed (/community) and in SavedTranscripts on /profile. Team management lives at /team-builder. None of the stored links point there.

Steps to Reproduce
  1. User A publishes a saved transcript as a community post (or has a saved transcript).
  2. User B comments on it → User A gets a "New Comment" notification. Click it → user A lands on the live spectator room /view-debate/<transcriptId>, not the comment.
  3. User A replies to User B's comment → User B gets a "New Reply" notification. Click it → "Debate Session Not Found" toast and a redirect to /startDebate.
  4. User C joins User A's team → User A gets a "New Team Member" notification. Click it → 404 page.
Expected Behaviour

Clicking a notification should open the page where the related content can be seen, for example:

  • comment/reply notifications → /community (or a dedicated post/transcript page, ideally scrolling to the comment)
  • team join notification → /team-builder
Suggested Fix
  • Update the link values in CreateCommentHandler and JoinTeam to point at existing routes (or add a dedicated /post/:id / /team/:id route on the frontend if maintainers prefer).
  • Optionally keep notification route strings in one place (shared constants) so backend links don't drift from App.tsx routes again.
  • Add a small backend test asserting the link created for each notification type.

Note: existing notifications already stored in MongoDB will keep the old links, so a one-off migration or a frontend fallback may also be worth discussing.

Environment Details
  • Checked on main @ 95b24b5
  • Frontend routes: frontend/src/App.tsx; notification click handler: frontend/src/components/Header.tsx
Impact

Medium - Feature works but has issues

Code of Conduct
  • I have searched existing issues to avoid duplicates
主要语言
TypeScript
星标
108
派生
266
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AOSSIE-Org/DebateAI 的其他 Issue

查看 AOSSIE-Org/DebateAI 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。