I have a very critical bug that appeared between 6401d60f0d3c7a1f8f135dace1ed80868cc28aea and bb0b834a2c98996fa38a735e60293894c1cc27a4 of fulcro
subforms started appearing in the delta as arrays of nil values making the form permanently dirty after making any change in it, but more importantly for me deleting all the entities of the subforms since the before is something and the after is nil which deletes with my storage plugin when delete-referrent is true
after a git bisect the first bad commit: [5392b484517216abb6d26f9fb17f326b135d0f24] Fixed a bug in remove-entity. It was not removing nested idents that were not part of the top-level normalized graph.
might be somewhat related to https://clojurians.slack.com/archives/C68M60S4F/p1724270092902999
Created an issue https://github.com/fulcrologic/fulcro/issues/554
Right, but did you update to the latest? I thought I already re-fixed this
and is this a RAD app, or are you using remove-entity somewhere else?
Try 3.7.10-SNAPSHOT. I went back and did what I should have done to start: made it an opt-in change to prevent these regressions. Sorry about that. I’m pretty sure that new version will fix it, and I can go into RAD and adopt the new thing in reports, which is what I was trying to fix.
I am using git deps and had the issue with bb0b834a2c98996fa38a735e60293894c1cc27a4
Which was the latest commit yesterday
Even as an option this seems like a bug (I am using rag indeed, this happens in subforms)
The latest should no longer be removing them unless requested, and I didn’t update forms to do so. So, now I’m puzzled
if you mean this one then maybe fd9148b0ed8d89587db1d09dcff0a8723bebe2e6 but yesterday it wasn't there
and you’re right, a delete child in a form needs the old idents as data. Which is one of the reasons why the original implementation didn’t remove them. But, the new implementation is opt-in for that.
I told you a snapshot version. The commit is fd9148b0ed8d89587db1d09dcff0a8723bebe2e6
I understand that the latest commit makes the new remove cihld behavior optional, but I'm saying the behavior feels wrong, it turns vectors of identities in subforms into vectors of nil as soon as you "touch" the form, even unlrelated fields, not just when you delete a child. It doesn't do that just for one particular field but for all subform fields, it deletes everything. and it's not reversible, cancelling the form doesn't restore the children in that case
yes, I agree that in the form case it makes no sense, but in other cases, completely removing an ident from state Does make sense
now, I would agree that turning the ident to nil in a vector is wrong
GC in general is a major pain, which is why I generally don’t do it much 😄
I have not had the time to debug yet to really understand what's going on, but in my case I do not delete anything so there should not be any GC at all. A simple example would be: I have a form with :user/name and :user/friends, friend is a subform with :user/name as well. I have a user with 2 friends, I change :user/name, now :user/friends becomes [nil nil] instead of [[:user/id 2] [:user/id 3]], without me touching any of those
I understand what you’re saying in the context of forms. But there ARE cases (such as when working with a report that has a stale value in its parameters) where removing the idents makes perfect sense. The recent change I just made fixes your case to no longer be an accident
I had a quick look and seems like the only place where that remove-entity is used is in use-gc hook, which I only have in the pickers
interesting so it is when one of these pickers appear of the screen that this happens
but the new version doesn’t have problems, right?
Has anyone tried RAG on the Fulcro docs and source?