pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Saving in the editor triggers 3 requests that include all of my bricks ever created

Open fregante opened this issue 3 years ago • 3 comments

Screen Shot

The named endpoints shown here all push 70-200 items each:

Screen Shot 3

The request total only ~70KB but take 1s-1.4s each, for a total of ~3 seconds to save a QuickBar extension with 2 bricks.

Questions

  1. Can these requests be limited to sending only the current extension? If further syncs are necessary, they can be done asynchronously in the background page.
  2. How can I nuke all of my extensions? 😅 I need a batch "select all"

Related

  • https://github.com/pixiebrix/pixiebrix-extension/issues/2720

fregante avatar Aug 02 '22 16:08 fregante

Side note: This other issue is more server-related, but I wonder if it's possible to reduce the time it takes to handle the 1.3KB PUT request (800ms are spent on the server, not on the network):

Screen Shot 4

fregante avatar Aug 02 '22 17:08 fregante

It is worth investigating why the mentioned PUT request is as big as 1.3KB

Another note. From a Slack conversation:

It makes 3 GET requests and 1 PUT. The issue is that the editor waits for all 4 requests

What probably happens is:

  1. the Editor updates an extension
  2. this update invalidates the RTKQ cache
  3. RTKQ has to pull the blocks data required to render the Editor page
  4. one of the invalidated buckets is the block definitions; we pull all of the available blocks in a single request (/bricks) that is getting only bigger.

BALEHOK avatar Aug 03 '22 10:08 BALEHOK

Yes, this is a known issue. IIRC, it's even less performant for blueprints. Right now, save performance isn't a priority

This other issue is more server-related, but I wonder if it's possible to reduce the time it takes to handle the 1.3KB

The server actually does analysis of extensions/blueprints on save (it keeps track of the dependency graph, etc.). Getting the time down will involve adding some caching to the analyses

How can I nuke all of my extensions? 😅 I need a batch "select all"

We can help you with that (will just delete from the server). It's becoming a problem for other devs as well too because dev/test extensions clutter the blueprints screen

If you want this, just let us know if there's any extensions you need to keep

Likely we'll introduce some bulk operations to the Blueprints Screen sooner than later

twschiller avatar Aug 03 '22 12:08 twschiller

This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.

github-actions[bot] avatar Dec 21 '23 00:12 github-actions[bot]

This issue was closed because it has been stale for 7 days with no activity.

github-actions[bot] avatar Dec 30 '23 00:12 github-actions[bot]