[🚀 Feature]: Remove deprecated JSON Wire ErrorCodes / Response.status (java)

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
28/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java
領域
api, backend

調査の方向性

ErrorHandler、ErrorCodec、および一覧にある Response と handshake/codec の呼び出し元から始め、ErrorCodec.decode() が整数ステータスの検索をどのように置き換えられるかを追跡します。public API を変更する前に、Appium の依存関係と提案されている ErrorHandler コンストラクターを確認します。内部のステータス参照箇所が移行され、ErrorCodes の削除パスが必要な Appium リリースを通じて調整されていれば完了です。

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

説明

A-needs-triaging C-java I-enhancement
Description

ErrorCodes and Response.status/getStatus()/setStatus() are leftover JSON Wire Protocol plumbing. They're still load-bearing in the W3C path: ErrorHandler resolves exceptions via getExceptionType(int) keyed off the integer Response.getStatus(). Removal is two independent efforts.

Interim state landed separately: both are now plain @Deprecated with javadoc pointing at the replacement (no forRemoval, to avoid promising a removal that isn't scheduled and to keep the build warning-free until the migration below happens).

Track A — Response.status integer (internal only)

No external consumer found; doable entirely within this repo.

  • Re-point ErrorHandler (lines 102-104, 258) off getExceptionType(int) onto the W3C state string via ErrorCodec.decode().
  • Migrate remaining internal readers of getStatus()/setStatus(): Response.fromJson, AbstractHttpResponseCodec, W3CHttpResponseCodec, W3CHandshakeResponse, ProtocolHandshake, ResponseConverter.
  • Flip Response.status/getStatus()/setStatus() to @Deprecated(forRemoval = true) once the internal callers above are gone (no consumers left to warn).
  • Remove Response.status/getStatus()/setStatus().

Track B — ErrorCodes (public API, Appium depends on it)

Appium subclasses it (ErrorCodesMobile extends ErrorCodes) and injects via new ErrorHandler(new ErrorCodesMobile(), true). Requires cross-repo sequencing:

  1. (Selenium) Make ErrorCodec extensible — public API to register custom state → exception mappings (currently private ctor + private static ERRORS list).
  2. (Selenium) Add an ErrorHandler constructor taking ErrorCodec; old ErrorHandler(ErrorCodes, …) delegates and stays deprecated.
  3. (Appium) Replace the subclass with one registration: "No such context found" → NoSuchContextException. (then wait for an Appium release)
  4. (Selenium) Mark ErrorCodes + ErrorHandler(ErrorCodes, …) forRemoval, then remove in a major release.
Have you considered any alternatives or workarounds?

Keep ErrorCodes indefinitely as legacy API and never remove it — needs no Appium coordination, reclaims no code.

Does this apply to specific language bindings?

Java

主要言語
Java
スター
34.6k
フォーク
8.7k
平均マージ
1日 23時間
マージ済み PR(30日)
86

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

SeleniumHQ/selenium のほかの issue

SeleniumHQ/selenium の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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