IDE copy/paste bug

Occurs during cut/copy/paste of a container from one form into another. In the destination form, deeply nested components may end up with names that duplicate other, existing components on the same form.

This plays merry hell with the Properties editor. Primary symptoms: a change made via the Property editor:

  • seems to undo itself in the graphical (WYSIWG) display, or
  • seems to appear in two separate places in the display.

On occasion, this seems to have happened even when the names are not quite identical, but one is a suffix of the other.

Workaround:

  1. In the Anvil IDE, save and exit the app.
  2. Use Git to obtain a local copy of the form’s .yaml file.
  3. Use grep to isolate all the names.
  4. Remove leading spaces from the resulting list.
  5. Sort the list, so that you can readily find the duplicates. You may find several distinct pairs of duplicates.
  6. Using your favorite text editor, locate each duplicate name, and change it to something unique in the form. Save your changes.
  7. Locally commit your change to Git
  8. git push the change back to Anvil
  9. Until this bug is fixed, be prepared to do this after any paste. This seems to be happening quite a lot in the last two days, and it’s quite a speed bump.

This is occurring in both Firefox and Chrome under Windows 10.

I’m not sure how long it’ll take to come up with a minimal sample that illustrates the problem. However, I already have an app-under-development where it is occurring quite frequently, and can direct Anvil tech support on how to quickly replicate the problem, with a (private) clone of the app.

Moved to Bug Reports – thanks! (In particular, I think it contains a detail that will really help us nail this one down…if you can email the private clone link to support@anvil.works with step-by-step replication instructions it will really help!)

Additional hints while working around this: If you find yourself with this problem, you can use the Undo button in the top-right of the editor (rather than having to fix it in Git). You can also try renaming the offending component(s) in the editor - if you have duplicate components, this should only rename one of them.

Re rename in IDE: Thanks, I wasn’t sure that would work.

However, to quickly determine which names are duplicates – and what other names to avoid – I still needed the grep/trim/sort trick.

Link to follow privately.