Widget: keep a message sent while offline, and send it when the connection is back
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
F-05 task 18. Today a message sent while offline fails with errorNetwork ("Connection error. Please check your network.", packages/widget/src/i18n.ts:53) and the visitor has to press Retry once they're back online.
What to do
- Before sending (
handleSend,packages/widget/src/widget.ts:738), checknavigator.onLine. If offline, show the visitor's message as waiting ("Will send when you're back online", a new string inWidgetLocaleStringswith an English default), and don't call the API. - Listen for the
onlineevent onwindowand send what's waiting, in order, one at a time. A message that then fails gets the normal error and Retry. - Remove the listener in
destroy(). Don't keep waiting messages in storage: they're for this page view only. - Going offline in the middle of a reply isn't part of this; that already fails with the network error and Retry.
Acceptance criteria
- Unit tests with
navigator.onLinemocked: a message sent offline isn't sent, it's sent onceonlinefires, two waiting messages go in order, and nothing is left listening afterdestroy() - An e2e test using Playwright's
context.setOffline(true), thenfalse, checking the reply arrives without a click - The waiting state is announced through the existing reply live region, and the axe checks still pass
- A minor changeset for
@chatcops/widget;pnpm test:coverage,pnpm lintandpnpm sizepass
Comment here to be assigned.
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 3時間 10分
- マージ済み PR(30日)
- 339
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
documentation
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
codercops/chatcops#555 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
codercops/chatcops#546 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
codercops/chatcops#542 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Server: validate `rateLimit.windowMs` before creating the limiter対応中かも @ashutoshpalhare が 2 日前に担当しました。 オープン
codercops/chatcops#452 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Widget: a "New reply" button when the visitor has scrolled up対応中かも @srujankaleru2007 が 3 日前に担当しました。 オープンenhancement widget
codercops/chatcops#420 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
enhancement tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
danielmiessler/LifeOS#2533 ·
メンテナーはふだん 9 日以内に返信
-
auto:producer auto:uiux
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fritzprix/libr-agent#2447 ·
メンテナーはふだん 1 日以内に返信
-
bug low priority
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100