Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Refactor API: Remove 'any' from EmbeddedChatApi and improve payload typing

オープン
#1,237 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
typescript

調査の方向性

packages/api/src/EmbeddedChatApi.ts から始め、connect()、callback のシグネチャ、autoLogin、sendMessage、handleUiKitInteraction を読みます。明示的な any を型付き入力とガードされたストリームアクセスに置き換えながら、packages/api の build と lint/type チェックを実行します。明示的な any が残らず、パッケージが新しいエラーなしでビルドできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

packages/api/src/EmbeddedChatApi.ts currently relies on multiple explicit any types across callback signatures, stream payload handling, auth inputs, and message APIs. This reduces type safety and makes it easier to accidentally access unsafe or undefined fields, especially when working with dynamic DDP payloads.

Problem

  • Explicit any appeared in:
    • message listeners
    • action/ui interaction listeners
    • autoLogin credentials
    • DDP stream callbacks (onStreamData)
    • sendMessage input
    • handleUiKitInteraction input
  • Stream payloads were accessed without defensive narrowing (fields, eventName, args).
  • SDK callback types are broad, so local guards are needed to keep runtime behavior while improving static safety.

Acceptance Criteria

  • No explicit any remains in packages/api/src/EmbeddedChatApi.ts.
  • connect() stream handling uses guarded/narrowed access.
  • sendMessage and handleUiKitInteraction use typed inputs.
  • packages/api builds successfully.
  • No lint/type errors introduced.

Impact

  • Better type safety and editor intelligence.
  • Lower risk of runtime errors from malformed DDP payloads.
  • No intended behavior changes at runtime.
主要言語
JavaScript
スター
165
フォーク
381
平均マージ
1日 2時間
マージ済み PR(30日)
1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RocketChat/EmbeddedChat のほかの issue

RocketChat/EmbeddedChat の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。