lehitoskin / ivy

Ivy, the Taggable Image Viewer
GNU General Public License v3.0
16 stars 3 forks source link

UI doesnt always properly reflect tags save state #67

Closed IonoclastBrigham closed 6 years ago

IonoclastBrigham commented 6 years ago

STR

  1. Click, or hit enter or , to focus the tags field
  2. Enter one or more new tags
  3. Hit enter or the "Set" button to save

Expected Result

Actual Results

Discussion

This only seems to happen sometimes. I haven't been able to narrow down what the minimal steps to reliably trigger it are. But, once I got in this state, it happened nearly every time I tried to save.

I can say I first noticed it when I opened a collection from the command line like $ find ~/images -type f -name '*foo*' | xargs ivy. It's possible the large number of commandline args (over 100) caused something to get gummed up.

IonoclastBrigham commented 6 years ago

Looks like this was happening because there were duplicate tag entries in the tags table. This was possible because I improperly disabled the unique attribute on the Tag_label column, which shouldn't happen in normal usage, but for ultimate correctness the code should be doing an upsert operation.

lehitoskin commented 6 years ago

According to the racquel docs, I already set this to be a thing. Using save-data-object will insert into the database if it is new or update if it already exists.

IonoclastBrigham commented 6 years ago

Bug in racquel?

IonoclastBrigham commented 6 years ago

I'm gonna close this, since it looks like it's self-inflicted. Let's keep it in mind, though, if we see future evidence that racquel might not be updating extant records correctly.