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

Aperta
#17,638 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
api, backend

Direzione di ricerca

Inizia con ErrorHandler, ErrorCodec e i caller di Response e handshake/codec elencati; traccia come ErrorCodec.decode() possa sostituire la ricerca dello stato intero. Esamina la dipendenza da Appium e il costruttore ErrorHandler proposto prima di modificare l’API pubblica. Il lavoro è completato quando i lettori interni dello stato sono stati migrati e il percorso di rimozione di ErrorCodes è coordinato tramite la release di Appium richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
34.6k
Fork
8.7k
Merge medio
1g 23h
PR unite (30g)
86

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SeleniumHQ/selenium

Tutte le issue di SeleniumHQ/selenium

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.