A field that’s a list of things had 11 items, then I deleted one, but workflows still think it has 11. Unclear if the 11th item is actually deleted from the database. I can still navigate to pages that use the 11th item, so I can see its Unique ID in the url, but searching for it in the live database in the editor yields no results. When I look at the list field, there are 10 items in the list, and the deleted one isn’t shown. But workflows that count the items in the list come up with 11.
What do I even do here? I can’t redelete an item that won’t show up in the database, and I can’t remove it from the list field if it’s not shown in the field!
Can you share screenshots of how you are initially populating the list of items, how you are deleting that item from the list, and then how your workflow runs after that?
Yeah, it’s a known issue. I reported it two years ago using the same terminology - i.e. phantom list items. Unfortunately, I was never informed by Bubble that the issue had been addressed.
The only fix and workaround I found is as follows.
Fix it by using “Clear list” to empty the list, and then add back the items you want to keep.
Prevent it moving forward by always doing two things: 1) Explicitly remove the item from the list, and 2) Delete the item from the DB.
So I can’t do screenshots because it seems to have resolved itself. I didn’t delete the item from the list. I deleted the item itself. A phantom version persisted in the list, but it seems to be gone now. Maybe there’s just some latency built in to deleting an item so that it takes time to remove it from other things, but that would be good to know. I spent an hour trying to resolve this because it was potentially app-breaking.
Yeah, I saw your posts! It seems to have resolved itself. It’s possible there’s latency built in to how Bubble deletes a thing. That’s fine, but hopefully this little thread helps someone in the future. To future Bubblers: just give it an hour or so before you worry about it!
Perhaps recent DB improvements have altered the behavior, but either way, I’d say it’s still best practice to remove the list item as well as delete the DB thing if you’re not already doing so. The issue I encountered could impact backend WFs due to an incorrect list item count. (Also IMO, it shouldn’t take an hour for expected behavior to manifest. )