Stats: remove the Jetpack Social Connections insight if its endpoint is dead

Abierto
#26,268 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
swift
Área
mobile

Línea de trabajo

First inspect the iOS Stats insight implementation for InsightType.publicize, StatsPublicizeInsight, and the pinned insights customization flow. Before removing anything, the issue requires checking WordPress.com server code to establish endpoint behavior and current clients, then coordinating with Android. If removal is confirmed, remove the insight, fetch and cache, and ensure pinned cards leave no empty slot.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

[Status] Needs Discussion [Type] Tech Debt Stats

The "Jetpack Social Connections" card in Stats Insights (InsightType.publicize) reads from an endpoint that appears to be unused everywhere else and returns no data for nearly every site. If that holds up, we should remove the card.

What we found

The card is built from GET /rest/v1.1/sites/<id>/stats/publicize (StatsPublicizeInsight in WordPressKit), which returns follower counts per social network.

  • It returns nothing in practice. It returned {"services": []} for 387 of the 389 sites on one account, including jetpack.wpmt.co. The other 2 don't have the Stats module.
  • It only knows about old networks. Calypso maps each returned service through a fixed table (PUBLICIZE_SERVICES_LABEL_ICON in client/state/stats/lists/constants.js) and would throw on any name it doesn't know. The table has 6 entries: Twitter, Facebook, Tumblr, Google+, LinkedIn and Path. It hasn't changed since 2016, and Path and Google+ no longer exist.
  • The newer Jetpack Social networks aren't covered. Jetpack Social now supports Bluesky, Facebook, Instagram, LinkedIn, Mastodon, Nextdoor, Threads and Tumblr (wpcom/v2/sites/<id>/publicize/services). We could not find follower counts for any of them in Calypso or in Jetpack's open-source Publicize package.
  • Calypso no longer shows it. The web Stats UI has no Publicize module anymore. Only a leftover STAT_TYPE_PUBLICIZE constant and its strings remain.

Requirement before removing anything

We have not looked at the WordPress.com server code for stats/publicize, because it isn't public. Before removing the card, someone must check it and confirm:

  • Which services the endpoint can return today, and whether any of the current Jetpack Social networks are included.
  • Whether the endpoint is deprecated or still maintained.
  • Whether any other client (Android, Calypso, Jetpack) still uses it.

If it is dead

  • Remove the publicize insight type, its card, and the StatsPublicizeInsight fetch and cache from the iOS app.
  • Make sure users who had the card pinned in "Customize your insights" don't end up with an empty slot.
  • Coordinate with Android, which likely has the same card.

Related

  • Found while converting the Stats xibs to code. The card renders the same before and after that work.
  • The card has a latent bug: with limitRowsDisplayed: false, only the first 6 rows are ever shown and there is no "View more". The endpoint can return at most 6 services, so real data can't trigger it. Removing the card makes it moot.
Lenguaje dominante
Swift
Estrellas
3.9k
Forks
1.2k
Merge medio
1 d 23 h
PR fusionados (30 d)
136

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wordpress-mobile/WordPress-iOS

Todos los issues de wordpress-mobile/WordPress-iOS

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.