automotive-design-compose icon indicating copy to clipboard operation
automotive-design-compose copied to clipboard

Live update stops working with frames containing large number of layers

Open FruitSnack1 opened this issue 2 years ago • 10 comments

When I paste a frame with 389 layers into document, live updates stops working. Frame contains only vectors so file size shouldn't be an issue.

Restarting the application doesn't seem to help. No errors in Logcat either. Design switcher status shows old version of document.

I got it to update once, but after that Live update stopped again.

FruitSnack1 avatar Jul 18 '23 06:07 FruitSnack1

Hi there. Sometimes this happens when something in the 389 layers has some kind of newer Figma property set that we don't yet support yet and fail to parse, causing deserialization of the Figma file to fail. Does the DesignSwitcher show any errors if you open it up? This is the little arrow at the top right that shows some live update info if you open it up like this: Screenshot 2023-07-19 at 1 25 14 PM

If you don't see anything there, is it possible to share a Figma document with the layers that cause this problem? Alternatively you could try taking subsets of those 389 layers to narrow down which part causes the problem.

rylin8 avatar Jul 19 '23 20:07 rylin8

Hi. No errors in DesignSwitcher. image But this time I got some errors in logcat. image Seems like some components are not accessable. Can this be because they are from shared file ? Unfortunately I am unable to share the document because of NDA.

FruitSnack1 avatar Jul 20 '23 10:07 FruitSnack1

Those errors mean that those nodes in your Figma documents are instances of components defined in other files. When DesignCompose comes across those types of nodes, it tries to download the full component from the other file, but sometimes fails for some reason (no access, original component has been deleted, etc). That's what look like has happened here. However, it usually does not cause an issue. The issue is logged to logcat, but it continues with the rest of the Figma document and renders what it can, so I don't think that is the issue here.

From what I see here, live update is still working. I don't know what is in all those layers you are copying, but without being able to see it I would suggest trying to break it down into smaller parts to see if it's a particular layer causing a problem. If you're able to reproduce this with a set of layers in a test doc not under NDA it would also be helpful and I can take a look.

rylin8 avatar Jul 21 '23 17:07 rylin8

I tried to figure out what could be causing this issue. And found out, that Live update works fine, but the fetch/parse takes too long (~4 min for component containing 3 icons).

image

Frame 2609299 (1) *images are blurred because of NDA

The component its fetching has 3 visible icons and another 8 hidden. All of them have 5 different variants. All of these components also have to be fetched from different file.

When I inserted a whole screen containing 389 layers the fetch/parse took so long I though that the Live update was broken.

FruitSnack1 avatar Aug 01 '23 08:08 FruitSnack1

Thank you @FruitSnack1 ! Can you confirm which version of DesignCompose your app is using right now? We had an early release that left excessive logging enabled that caused significant fetch delays.

timothyfroehlich avatar Aug 01 '23 15:08 timothyfroehlich

Hi, The version is v0.21.0

FruitSnack1 avatar Aug 03 '23 11:08 FruitSnack1

@FruitSnack1 I think this could also be caused by components referenced from the layers being in other documents. In that case, DesignCompose fetches the referenced documents and also processes those in order to extract the full components (in case they have variants, etc).

We're going to add some logging to surface things that could take a long time during fetch (#281), so hopefully in a future release you'll be able to repro and we can find out what to do to make a fix.

iamralpht avatar Aug 09 '23 20:08 iamralpht

Just figured out a quick solution.

In Figma you can detach all instances (turn components into frames, shapes, ...).

Without all the components and variants from different files, live update works normal and updates in matter of seconds, event with frames containing hundreds of layers.

To "detach all instances":

  1. Select all elements you want to detach
  2. Press Ctrl + / (Command + / on mac)
  3. Run the "Detach all nested instances" command

PS: Command should be ran in different file to avoid fetching all the components.

FruitSnack1 avatar Aug 10 '23 08:08 FruitSnack1

Ok, excellent. Are you using Figma's Design Library feature? We're wondering if we should restrict recursive doc fetching only to situations where a Design Library is in use (which would also limit the number of docs that must be fetched).

iamralpht avatar Aug 10 '23 17:08 iamralpht

Yes we do.

FruitSnack1 avatar Aug 11 '23 11:08 FruitSnack1