wordpress-mobile / wordpress-mobile/WordPress-iOS

`syncBlogs` makes too many HTTP requests

Open
#20,964 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Enhancement Jetpack
Dominant language
Swift
Stars
3.9k
Forks
1.2k
Avg merge
23h 51m
Merged PRs (30d)
58

Description

This issue could be an improvement worth look into.

There is a syncBlogs function which is called in many places in the app, during login, from the site picker, etc. This function makes a HTTP request to get all blogs the current user has access to. It then fires many HTTP requests to get all blogs' "Jetpack Capabilities", one request for each blog.

I don't think it's efficient to make many HTTP requests to the same API endpoint. It would be slow for Automatticians who probably have close a hundred of blogs to complete all these API calls.

We can potentially look into add an API endpoint that accepts a list of sites and returns their capabilities.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with syncBlogs in WordPress/Classes/Services/BlogService.m and JetpackCapabilitiesServiceRemote.swift, then trace its callers during login and site selection. The issue needs a concrete scope for reducing per-blog requests; done should include an agreed request strategy and verification that syncBlogs no longer makes one capability request per blog.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, swift
Domain
api, mobile-dev, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.