fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
2020-11-21T13:13:23.242300Z

I'm trying to do a remote mutation (deleting a note) and I'm having an issue when I get down to https://github.com/fulcrologic/fulcro/blob/fulcro-3.4.3/src/main/com/fulcrologic/fulcro/mutations.cljc#L80 Here's my trace... the issue is that it inserts this 2 nil into the state for some reason whereas I'm trying to delete :note/id 2. Update: I guess it's because of this part from the update-in docstring: > If any levels do not exist, hash-maps will be created. So in my case, [:note/id 2] does not exist, and it gets created as 2 nil, but why? I am deleting this exact object in the client mutation using:

(normalized-state/remove-entity state-map                      
                                [:note/id note-id]                      
                                #{:note/card-list :card-list/cards}) 
=> {:com.fulcrologic.fulcro.application/active-remotes #{}, :fulcro.inspect.core/app-id "buidler.ui/Root", :fulcro.inspect.core/app-uuid #uuid "fde8c483-7e26-4bfd-87fe-fdce9e8d9654", :note-form {:singleton #:note{:text ""}}, :note-list {:singleton #:note-list{:notes [[:note/id 1]]}}, :note/id {1 #:note{:delete-visible? false, :id 1, :text "foo from server"}}, :root/note-form [:note-form :singleton], :root/note-list [:note-list :singleton]}

tony.kay 2020-11-23T16:22:41.269600Z

Does the nil cause any runtime problem? I’m not terribly interested in a “bug not bug” that leaves harmless nils laying around.

2020-11-23T23:33:49.274600Z

I thought it was causing a runtime problem on refresh, but the error is of course mine. I was neglecting to update the note-list-table which had the note ids, while at the same time deleting particular notes, so the ids in the table could no longer be found on the next refresh. Oh well, I learned lots about debugging through my stupid mistake :)

👍 1
lgessler 2020-11-21T17:20:16.242900Z

it's hard for me to speculate just from what you've said--if you could share some code (e.g. for the mutations) that'd be helpful

2020-11-21T17:23:39.243200Z

@lgessler it's a followup to this thread here https://clojurians.slack.com/archives/C68M60S4F/p1605367455177800 Note that the issue does not seem to be in rewrite-tempids!, but in update-errors-on-ui-component!.

lgessler 2020-11-21T17:31:09.243500Z

ah i see thanks, boy that's a hairy thread

lgessler 2020-11-21T17:34:41.243700Z

need go afk for the moment but if i were to debug this i think i'd try to find a way to look at what happens once the mutation response is received in the client, as early as possible

lgessler 2020-11-21T17:42:59.243900Z

oh, and another idea in case you haven't tried it yet: the DB tab of fulcro inspect has a bar in the top left you can use to step through app state after every tx... might catch something interesting there

2020-11-21T17:48:30.244100Z

Thanks, will try those options.

lgessler 2020-11-21T21:00:42.244600Z

typed dom/marquee, no match. sad 😢

lgessler 2020-11-21T21:01:12.244700Z

i know i know, it's obsolete, user-hostile, etc.

2020-11-21T21:16:30.244900Z

Nothing really sticks out in the tx list:

16:14:48:940
(buidler.mutations/delete-note {:note/id 2})
16:14:46:566
6
(com.fulcrologic.fulcro.mutations/set-props {:note/delete-visible? true})
16:14:04:173
LOAD  
[{[:note-list :singleton]
  [{:note-list/notes
    [:note/id
     :note/text
     :note/delete-visible?
     {:note/card-list