archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
154 stars 53 forks source link

Canvas Images not always saved to "temp.archimate" file #125

Closed Phillipus closed 4 years ago

Phillipus commented 4 years ago
  1. Add a Canvas and an Image to a model.
  2. Commit
  3. Remove the Canvas
  4. Commit
  5. Select the Commit in the History view that had the Canvas and Image and choose "Restore to this Commit"
  6. The image is missing

If you now:

  1. Undo last commit (the "Restore") commit
  2. Select the Commit in the History view that had the Canvas and Image and choose "Restore to this Commit"
  3. The image is not missing

It alternates between image missing and not missing.

This is caused by a sequence of events where

  1. The Model is open in the Model Tree
  2. A coArchi action occurs where the Model is exported to Grafico and its images are saved to the Global ArchiveManager#BYTE_ARRAY_STORAGE
  3. The Model is unloaded from the Model Tree. This causes the ArchiveManager#BYTE_ARRAY_STORAGE to clear the images.
  4. The Model is reloaded.

Why it does it every other time I don't know.

The workaround is to unload the model from the Model Tree before doing such an action.

I need to investigate what the sequence of events is...

May be related to #120

Phillipus commented 4 years ago

I've committed a fix for this, so closing.