fulcro

Eric Dvorsak 2024-09-26T16:33:52.320309Z

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

Eric Dvorsak 2024-09-26T16:38:55.110429Z

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.

Eric Dvorsak 2024-09-26T16:43:39.440829Z

might be somewhat related to https://clojurians.slack.com/archives/C68M60S4F/p1724270092902999

Eric Dvorsak 2024-09-26T19:25:42.028359Z

Created an issue https://github.com/fulcrologic/fulcro/issues/554

tony.kay 2024-09-26T20:02:13.930699Z

Right, but did you update to the latest? I thought I already re-fixed this

tony.kay 2024-09-26T20:18:58.297619Z

and is this a RAD app, or are you using remove-entity somewhere else?

tony.kay 2024-09-26T20:47:23.730569Z

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.

Eric Dvorsak 2024-09-27T05:22:48.104339Z

I am using git deps and had the issue with bb0b834a2c98996fa38a735e60293894c1cc27a4

Eric Dvorsak 2024-09-27T05:23:23.962169Z

Which was the latest commit yesterday

Eric Dvorsak 2024-09-27T05:24:36.356949Z

Even as an option this seems like a bug (I am using rag indeed, this happens in subforms)

tony.kay 2024-09-27T13:07:07.725709Z

The latest should no longer be removing them unless requested, and I didn’t update forms to do so. So, now I’m puzzled

Eric Dvorsak 2024-09-27T13:08:24.271359Z

if you mean this one then maybe fd9148b0ed8d89587db1d09dcff0a8723bebe2e6 but yesterday it wasn't there

tony.kay 2024-09-27T13:08:37.059369Z

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.

tony.kay 2024-09-27T13:08:59.771619Z

I told you a snapshot version. The commit is fd9148b0ed8d89587db1d09dcff0a8723bebe2e6

Eric Dvorsak 2024-09-27T13:11:57.777239Z

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

tony.kay 2024-09-27T13:25:52.915389Z

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

tony.kay 2024-09-27T13:26:10.721049Z

now, I would agree that turning the ident to nil in a vector is wrong

tony.kay 2024-09-27T13:26:49.292849Z

GC in general is a major pain, which is why I generally don’t do it much 😄

Eric Dvorsak 2024-09-27T13:28:58.275059Z

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

tony.kay 2024-09-27T13:30:26.622139Z

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

Eric Dvorsak 2024-09-27T13:40:24.670219Z

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

Eric Dvorsak 2024-09-27T13:45:23.343819Z

interesting so it is when one of these pickers appear of the screen that this happens

tony.kay 2024-09-27T17:48:40.430109Z

but the new version doesn’t have problems, right?

sheluchin 2024-09-26T21:04:34.730619Z

Has anyone tried RAG on the Fulcro docs and source?