hyperfiddle-2020 icon indicating copy to clipboard operation
hyperfiddle-2020 copied to clipboard

Picklist server searching is broken when hf/iframe gets free params from parent fiddle

Open dustingetz opened this issue 5 years ago • 1 comments

This is only noticeable in Rosie which has big enough picklists. I believe this is an interaction between 3 things: the s/cat refactor, the picklist server io, and the automatic link formulas (link/path).

So for example, this picklist gets an automatic sub from the parent fiddle, which the hf/defaults elides:

(defmethod hf/defaults `esub-region-masterlist [[_ sub needle]]
  `(esub-region-masterlist ~(or needle "")))                ; elide accidental sub from parent fiddle

This seems to be the case that is broken since s/cat changeset.

This rabbit hole goes deeper though. I looked into fixing the hack at the root cause like this, (note the :formula added to suppress the automatic sub argument)

                     :links {:sub/id      [[`sub-blocked-list]
                                           [`sub-requests]
                                           [`rosie-entity-history]
                                           [:hf/iframe `sub-rename :tx-fn ":zero"]
                                           [:hf/iframe `school-requested-block :tx-fn (str `school-requested-block)]]
                             `sub-display [[:hf/iframe `esub-region-masterlist :formula ::hf/nil]
                                           [:hf/iframe `all-locations          :formula ::hf/nil]
                                           [:hf/iframe `all-subs               :formula ::hf/nil]]}

This cleans up the hf/defaults hacks as well as suddenly cleans up the EDN view buggy iframes, which appears to indicate that too many partitions have loaded (and also indicates a performance problem). However the above patch crashes in picklist renders, the context-of call computes the wrong PID. The PID on the server is at eav [nil nil nil] but the PID on the client is at eav [nil nil sub] per below

image

So there is some sort of context-refocusing deep bug.

To see the pids use the following patch: image

To test the above formula hacks use the following patch:

image

dustingetz avatar Aug 31 '20 02:08 dustingetz

@ggeoffrey we will need to tag team this, Rosie's sub pickers are broken until we fix it. We're going to have to go to prod with this broken and then fix it asap.

dustingetz avatar Aug 31 '20 02:08 dustingetz