NO BUG: Autosave does not save components

The autosave does not save a component.

Here is a video of me applying the last revision and it show the components in the structure tree, but with the “NO” symbol indicating the component is missing. The revision was an autosave, but it did not save the component.

This happend on v2.0.2 and v2.1-beta.

https://jam.dev/c/2a062b70-6923-4418-a38f-2084fd342e07

Hi Mark,
Thanks so much for your report!

The autosave only saves the Bricks element of the current page/template.
Global data like components, theme styles, etc. need an explicit save and are not captured by the autosave. We’ll add a description next to the Autosave setting, but it’s not a bug.

Best regards,
timmse

1 Like

So we have a similar situation here: we have 3 devs working on different templates and different components.

It only happened to one of us, where I had the page to showcase the components, and came by later they got disconnected and lost.

I understand autosave doesn’t save components, but since components get saved as an array in the option table, it should be at least still available in the components list to add them back in.

But I believe the autosave actually makes them lose in a way. I am currently trying to recover them via revisions, but no luck so far.

Maybe there is a way, or maybe we just need to build them back up again.
Some insight/guidance would be helpful here on how to proceed with multiple devs, and again, we are working on different templates and components.

Hi @cdeweerdt,

Thanks for the report.

I noticed that you created the same report in two topics (the other one being here: WAIT: Saved component no longer exists - #26 by cdeweerdt). To keep the investigation easier to follow, let’s continue in one place only.

Based on your description, the important part here is not really autosave itself, but the fact that multiple users were editing components/templates in the builder at the same time.

Components are global data. They are not stored only inside the individual page/template where they are used. The page/template stores the component instance/reference, while the actual component definition is stored globally. So even if each developer is working on a different template, component changes can still affect the same shared global components data.

This means that if two or more builders have component data loaded at the same time, one user may be working with stale component data. A later save from that builder can potentially overwrite newer component changes made by another user. That could explain why components appear disconnected or no longer exist, even though they were previously saved.

Autosave/revisions can only help with the current page/template canvas. They cannot reliably restore the global component definition itself. So if a revision brings back a component instance, but the global component definition no longer exists, the instance may still point to a missing component ID. This is also covered in the Save & Publish docs: Save & Publish | Bricks Academy

For recovery, the realistic options are:

  1. Restore the database/site from a backup created before the components were lost.
  2. Re-import the components from a previously exported components JSON file. (documented here: Components | Bricks Academy)
  3. Rebuild the missing components manually.

For multi-developer workflows, we recommend treating components as shared/global data:

  • Avoid editing components in parallel.
  • Make sure components are saved explicitly after creating or editing them.
  • Refresh/reopen the builder after another developer makes component changes.
  • Export components before larger changes or before multiple developers work on component-heavy parts of the site.
  • Avoid keeping the builder open for a long time while other users are also editing components.

If the components were definitely saved (and it’s not possible that somebody would override them), and then disappeared later, please check whether the missing component still exists in the bricks_components option, from where you can restore it.

Thank you,
Matej