Automattic / Automattic/edit-flow

Scalability: Prevent EF from loading every author all at once

Open
#450 2 comments 0 reactions 0 assignees View on GitHub
Module: Notifications Module: User Groups
Dominant language
PHP
Stars
366
Forks
137
Avg merge
2h 11m
Merged PRs (30d)
6

Description

Extracting an issue that arose in https://github.com/Automattic/Edit-Flow/issues/265

There are two places where Edit Flow will load every author+ (editor & admins included) all at once, which could present scaling issue on a site with a very large amount of users with author capabilities.

As a side note - It's worth noting that WP core will also load every author+ for the core author metabox. This ends up being one giant select field. I'm thinking there could possibly be some value here for EF to perhaps unset the core metabox and register it's own, perhaps using part of the solution used to solve this issue.

The two places where EF currently loads all users are:

1. On every post/page's notifications meta box:
![notifications-mb](https://user-images.githubusercontent.com/8536129/38341143-b5a63042-383c-11e8-8e7a-aa5c5a1cc362.png)

2. When editing a group:
![edit-user-group](https://user-images.githubusercontent.com/8536129/38340791-d878544e-383a-11e8-8d17-9001a4e6ce52.png)

From @sboisvert:
> I could see a hybrid model where we show all authors if the count is less then X where X is filterable with a default of let's say 20 [totally arbitrary number] and then if you want more you need to search. Maybe in the UI we'd put a note at the bottom of the list that mentions that you need to search to get more results. This should allow us to have the inline disabled button. That being said, I might be overthinking it and Ajax is the way to go.

I'm also thinking it will be important that all currently subscribed/selected users are always loaded and shown at the top. As a part of implementing this, the `All` and `Selected` filter logic and UI could likely be done away with.

Contributor guide

Open the contributing guide

Research direction

Start by locating the notification meta box on post and page editing screens and the user-selection UI when editing a group. Review how both places currently load authors, then compare the proposed hybrid threshold, AJAX search, and selected-user behavior; completion criteria are not settled in the issue. Also review the related issue 265 and the WordPress core author metabox context.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.