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

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
活発
技術スタック
swift
領域
mobile

調査の方向性

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.

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

説明

[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.
主要言語
Swift
スター
3.9k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
136

環境構築

はじめの一歩

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

wordpress-mobile/WordPress-iOS のほかの issue

wordpress-mobile/WordPress-iOS の issue をすべて見る

似ている issue

Swift の issue をもっと見る

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

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