Remove client code for deprecated V1 /user-notification and /feature-flags (useSorobanPublic)

Aperta
#2,886 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
64/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
typescript

Direzione di ricerca

Inizia dagli helper di Account elencati, dagli handler loadBackendSettings/saveSettings e dallo stato delle impostazioni del popup per tracciare entrambi i percorsi deprecati. Aggiorna i consumer indicati di Account, asset-visibility e asset-selection, quindi esegui i test Account e gli stub e2e referenziati. È terminato quando non rimangono riferimenti a endpoint V1 o flag Soroban, il selettore usa isRpcHealthy e i flag V2 e MaintenanceBanner sono invariati.

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

Descrizione

backend-migration

Client-side follow-up to stellar/freighter-backend-v2#122 (V1 endpoint deprecation, part of the V1 decommission).

The backend team is dropping two V1-only endpoints that were never ported to V2. Both are consumed exclusively by this extension, so we need to remove the related client code. Neither feature is lost — /user-notification is superseded by the Amplitude-driven MaintenanceBanner, and useSorobanPublic has been hardcoded true on the backend for its entire life.

⚠️ Sequencing (must ship before/with the V1 removal)

The /feature-flags fetch falls back to { useSorobanPublic: false } on failure. On mainnet that flips isSorobanPublicEnabled false and fires a false "Soroban is temporarily experiencing issues" toast to all mainnet users. So this client change must land before or simultaneously with the V1 endpoint removal. (/user-notification falls back to {enabled:false} and is harmless if removed first, but we should clean it up regardless.)

⚠️ Do NOT confuse three "feature-flags" systems

  1. V1 backend /feature-flags → useSorobanPublic — this is the only one being removed.
  2. V2 backend /feature-flags → swap_enabled/discover_enabled/onramp_enabled — different endpoint, actively used, leave alone.
  3. Amplitude fetchFeatureFlags in remoteConfig.ts → maintenance_banner — unrelated, leave alone.

Scope — remove /user-notification

  • extension/src/background/helpers/account.ts:344-356 — getUserNotification() fetch
  • extension/src/background/messageListener/handlers/loadBackendSettings.ts — stop returning userNotification
  • extension/src/popup/ducks/settings.ts — initialState.userNotification (:87), saveBackendSettings writes (:412, :418)
  • extension/src/popup/views/Account/index.tsx:255-266 — the <Notification> render block (the only render site) + selector read at :59
  • @shared/api/internal.ts — loadBackendSettings() return shape (:1914-1923), UserNotification import (:63)
  • @shared/api/types/types.ts — UserNotification interface (:213-216) + userNotification fields (:75, :222)
  • e2e stubs / test mocks: extension/e2e-tests/helpers/stubs.ts:41-46,2952, Account.test.tsx:358,400 (testid account-view-user-notification), and other *.test.tsx supplying userNotification

Scope — remove useSorobanPublic / V1 /feature-flags

  • extension/src/background/helpers/account.ts:358-370 — getFeatureFlags() fetch
  • extension/src/background/messageListener/handlers/loadBackendSettings.ts and saveSettings.ts — drop isSorobanPublicEnabled: featureFlags.useSorobanPublic mapping (two consumers)
  • extension/src/popup/ducks/settings.ts — initialState.isSorobanPublicEnabled (:85), debug reset (:158), reducer writes (:412-416, :446-468), and simplify settingsSorobanSupportedSelector (:663-669) to just isRpcHealthy
  • UI consumers via that selector (no behavior change intended, verify each): Account/index.tsx:58,92-102 (Soroban toast), manageAssets/AssetVisibility/index.tsx:33,111 (--short class), manageAssets/ChooseAsset/index.tsx:34,139 (--short class)
  • @shared/api/types/types.ts:73,220,232 and @shared/api/internal.ts:1672,1915 — isSorobanPublicEnabled type/default

Done when

  • No client references to /user-notification or the V1 /feature-flags endpoint / useSorobanPublic / isSorobanPublicEnabled remain.
  • settingsSorobanSupportedSelector returns isRpcHealthy on all networks; no mainnet regression (no spurious Soroban toast).
  • V2 /feature-flags (swap/discover/onramp) and the Amplitude maintenance_banner path are untouched.
  • Tests/e2e stubs updated; MaintenanceBanner remains the notification surface.

Refs: stellar/freighter-backend-v2#122

Lingua principale
TypeScript
Stelle
122
Fork
62
Merge medio
4g 19h
PR unite (30g)
41

Preparare l'ambiente

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 stellar/freighter

Tutte le issue di stellar/freighter

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.