Repository navigation
Conversation
… subs
Enable an output on a worksheet that has already been run, re-run it, and the
output has no value in the results and no row in the table shading filters.
`solve-worksheet` took its output set from
`@(rf/subscribe [:worksheet/all-output-uuids ws-uuid])`, and that cached
reaction does not re-run between the user's click and the solve. Ticking an
output writes only to the DataScript conn, never to `app-db`. Reloading the page
before re-running avoided it, because that rebuilds every subscription.
The output still appeared in the solver log, which hid this for a long time.
`run-module` appends every output-source-link to the set it computes:
module-outputs (-> all-outputs
(filter-module-outputs gv-uuids)
(add-source-link-outputs output-source-links))
Surface length_to_width_ratio is the source of a link into Contain's
length_to_width_ratio input, so it was computed and logged with a real value,
then dropped again by `remove-source-link-outputs`, which removes exactly those
source-link outputs that are not in `all-outputs`. No header, no cell, so
nothing for `update-all-table-filters-from-results` to seed min/max from, and
`:worksheet/table-settings-filters` needs both bounds before a filter row shows.
So `behave.solver.queries/enabled-output-uuids` reads the conn directly, and
`solve-worksheet` and `store-all-diagrams!` use it. A solve wants the database
as it stands this instant; it runs in the same breath as the writes from
`:wizard/before-solve`.
This also reverts the `:worksheet/enabled-output-uuids` re-posh sub and the
rewiring of `:worksheet/output-uuids-conditionally-filtered`,
`:worksheet/output-uuids-filtered`,
`:worksheet/directional-parent-output-uuids`,
`:worksheet/graphed-output-uuids` and `:worksheet/all-output-uuids` onto it.
Reverting proves it was not the cause: the same failure reproduces on
kc-BHP1-1663-fix-diagram-summary-outputs, where the sub reads the conn
directly, because the fault was the cached reaction in front of the solve
rather than what the sub's body read. Those five subs are back to their
b08a079 form.
Kept: the `continuous-fmt` guard, so a non-numeric cell renders the "-"
placeholder instead of printing the string "NaN", and the matching nil checks in
the result matrices. That is a backstop against a bad cell, independent of this
cause.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
After working through the testing script (1st try with Heading + RoS, I'm a bit skeptical Re-Posh is the issue, since that should re-trigger Is it better to rely on reactive entity? IIRC, that is a faster lookup method as well? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Problem
Run a worksheet, go back to Outputs, tick another output, re-run — the new output has
no value in the results (
-) and no row in Table Shading Filters.Cause
solve-worksheetread its output set from@(rf/subscribe [:worksheet/all-output-uuids …]).That cached reaction doesn't re-run between the click and the solve: ticking an output
writes only to the DataScript conn, never to
app-db.Changes
behave.solver.queries/enabled-output-uuids, a direct read of the conn.solve-worksheet(core.cljs:242) andstore-all-diagrams!(diagrams.cljs:78) use itinstead of subscribing.
:worksheet/enabled-output-uuidsfrom BHP1-1660. Re-posh caused the issue with the solver not seeing the new output.continuous-fmtguard so a non-numeric cell renders-instead of printing thestring
NaN, plus the matching nil checks in the result matrices. Backstop only.Related Issues
Closes BHP1-1680
Submission Checklist
BHP1-### <title>)clj-kondo --lint components/**/src bases/**/src projects/**/src)clojure -M:compile-cljs)Testing
Screenshots