Skip to content

Fetch every page of syncable sites and mark already-connected ones#3788

Open
shaunandrews wants to merge 1 commit into
trunkfrom
fix-syncable-sites-fetch
Open

Fetch every page of syncable sites and mark already-connected ones#3788
shaunandrews wants to merge 1 commit into
trunkfrom
fix-syncable-sites-fetch

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Related issues

  • Part of the site-creation onboarding redesign — see the umbrella PR (linked below once open) for the full plan.

How AI was used in this PR

Split out of the workbench/site-creation exploration branch with Claude Code; designed and tested by Shaun on the original branch.

Proposed Changes

  • Users with many WordPress.com sites were only seeing a subset in the site picker: the unpaginated v1.2 /me/sites request silently truncated results. The fetch now drains every page via the v1.3 endpoint, so the full account is always available.
  • Sites that are already connected to a local site are now marked as such, so pickers can show an "already connected" state instead of offering them again.

Testing Instructions

  • With a WordPress.com account that has more than 100 sites, open the sync "Connect site" modal — every site should be listed.
  • Connect a site, then reopen the picker — the connected site should appear as already connected.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 7e00f62 vs trunk

app-size

Metric trunk 7e00f62 Diff Change
App Size (Mac) 1354.73 MB 1354.73 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 7e00f62 Diff Change
load 1643 ms 1662 ms +19 ms ⚪ 0.0%

site-startup

Metric trunk 7e00f62 Diff Change
siteCreation 9035 ms 9049 ms +14 ms ⚪ 0.0%
siteStartup 4403 ms 4404 ms +1 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@youknowriad

Copy link
Copy Markdown
Contributor

This doesn't feel great to me. We shouldn't be fetching unpaginated results, there's a risk here depending on the number of sites of a given user. Instead I believe it's better to have a UI that is either paginated or load on scroll or things like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants