Your NameandClaude Sonnet 5 9adadaa57d feat(web): 实现强制下线通知与顶号互踢的客户端感知(Ctrl 205 evicted)
按docs/强制下线通知与顶号互踢-后端接口文档.md §2实现。该文档§2.4声称
"SDK侧已内置:收到后关闭autoreconnect并回调onKick(reason, ctrl)"——读
实际安装的tinode-sdk(0.25.3)真实源码确认这个说法不成立:SDK对
code:205/text:"evicted"只有topic级的内部处理(topic._resetSub()),账
号级(topic为空)完全没有特殊逻辑,也没有onKick这个回调。

改为用SDK真实存在、此前项目里完全没用过的onCtrlMessage钩子(每条
{ctrl}包都会触发,含账号级的)在connection.ts里自行判定
"code===205 && text==='evicted' && !topic"。检测到后立即:清空
sessionStorage的token、清空myUserId、调用resetTinode()——其内部的
disconnect()会把SDK自己的#boffClosed标记置真,这是唯一能真正阻止
backoff计时器安排下一次重连的方式(读真实bundle的Connection#init_ws
确认,不存在另外一个"关闭autoreconnect"的方法)。只有面向用户的弹窗
和跳转延后到用户点确定,逻辑上是"会话立刻终止,通知是补充说明",不
是"通知完才终止"。

新增KickedNoticeRoot(挂载在App.tsx顶层,和ConfirmDialogRoot/
GlobalToastRoot同一层级,保证任意页面被踢都能弹出),文案原样照抄文
档§2.4的表格(reason→标题/正文),单一"确定"按钮(不是取消/确定二
选一——已经被踢了,没有"取消"这个选项,给出会误导)。确认后用
window.location.href硬跳转/login,和client.ts的forceReauth()同一个
理由:保证内存里的每一处状态(TanStack Query缓存等)都从头重置,不用
指望每个组件各自正确响应"你已经被登出了"。

topic非空的205(群内移出等topic级事件)不受影响,走原有的SDK内部
处理,不弹这个全局提示。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 11:13:28 +08:00
2022-06-19 12:53:09 -07:00
2026-01-20 12:58:58 +03:00
2026-07-04 15:19:03 +03:00
2018-04-21 21:46:21 -07:00
2018-08-13 11:36:50 +03:00
2021-11-10 14:11:53 -08:00
2026-07-04 15:19:03 +03:00
2020-02-14 09:58:03 +03:00
2025-10-27 19:32:33 +03:00
2025-10-27 19:32:33 +03:00

Tinode Web

Briefing

Single-page web chat application for Tinode. The app is built on React. The Tinode javascript SDK has no external dependencies. Overall, it's a lot like open source WhatsApp or Telegram web apps.

Although the app is generally usable, keep in mind that this is work in progress. Some bugs probably exist, some features are missing. The app was tested in the latest Chrome & Firefox only. NPM package is available.

Try possibly newer or older version live at https://sandbox.tinode.co/.

For demo access and other instructions see here.

Installing and running

This is NOT a standalone app, this is just a frontend, a client. It requires a backend. See installation instructions. See instructions for enabling push notifications.

Getting support

Helping out

  • If you appreciate our work, please help spread the word! Sharing on Reddit, HN, and other communities helps more than you think.
  • Consider buying paid support: https://tinode.co/support.html
  • If you are a software developer, send us your pull requests with bug fixes and new features.
  • If you use the app and discover bugs or missing features, let us know by filing bug reports and feature requests. Vote for existing feature requests you find most valuable.
  • If you speak a language other than English, translate the apps into your language. You may also review and improve existing translations.
  • If you are a UI/UX expert, help us polish the app UI.
  • Use it: install it for your colleagues or friends at work or at home.

Internationalization

The app is fully internationalized using React-Intl. The UI language is selected automatically from the language specified by the browser. A specific language can be forced by adding #?hl=XX parameter to the URL when starting the app, e.g. https://web.tinode.co/#?hl=fr.

The app is currently available in the following languages:

  • English - default
  • Arabic
  • Chinese simplified
  • Chinese traditional
  • French
  • German
  • Italian
  • Korean
  • Romanian
  • Russian
  • Spanish
  • Thai
  • Ukrainian
  • Vietnamese

More translations are welcome. See instructions.

Not done yet

  • End-to-End encryption.
  • Emoji support is weak.
  • Mentions, hashtags.
  • Previews not generated for links and docs.
  • Location and contact sharing.
  • Recording video messages.

Other

Responsive design

Desktop screenshot

Desktop web: full app

Mobile screenshots

Mobile web: contacts Mobile web: chat Mobile web: chat dark mode Mobile web: topic info Mobile web: forward message Mobile web: video call

S
Description
No description provided
Readme
111 MiB