Skip to content

merge_srv fix for module that pairs merge$data() with merge$variables()#83

Open
m7pr wants to merge 1 commit into
mainfrom
merge_srv_fix
Open

merge_srv fix for module that pairs merge$data() with merge$variables()#83
m7pr wants to merge 1 commit into
mainfrom
merge_srv_fix

Conversation

@m7pr
Copy link
Copy Markdown
Contributor

@m7pr m7pr commented May 12, 2026

Discovered at teal.modules.clinical at 279-interactive_variables@main branch at CI/CD failuers https://github.com/insightsengineering/teal.modules.clinical/actions/runs/25669146947/job/75349459478?pr=1470
at test-shinytest2-tm_t_pp_laboratory.R file

Motivation

merge_srv exposed merged column names through variables_selected, which was implemented as eventReactive(selectors_unwrapped(), …). The body of that expression also calls teal.data::join_keys(data()), but eventReactive only invalidates when its first argument changes. As a result, when the incoming teal_data reactive updates while pick selections stay the same (e.g. after filtering or other upstream data changes), the merged dataset reactive (data_r) can refresh while variables() still returns a stale mapping. Any module that pairs merge$data() with merge$variables() to build analysis or UI code can then see column names that no longer match the merged frame.

@m7pr m7pr added the core label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename                  Stmts    Miss  Cover    Missing
----------------------  -------  ------  -------  -------------------------------------------------------------
R/as_picks.R                140      21  85.00%   63, 167-171, 182-186, 201-207, 229-231
R/assertion.R                 5       0  100.00%
R/call_utils.R              147      22  85.03%   23-28, 65, 132-138, 259, 279-280, 283-287, 292
R/helpers.R                   9       0  100.00%
R/interaction.R              42       1  97.62%   95
R/module_merge.R            254       2  99.21%   325, 604
R/module_picks.R            323      23  92.88%   47-53, 72, 109-110, 299-301, 303-307, 441, 490, 528, 540, 548
R/picks.R                   183       1  99.45%   335
R/print.R                    36       2  94.44%   50, 58
R/resolver.R                141      15  89.36%   110-118, 284-289
R/tidyselect-helpers.R       29       0  100.00%
R/tm_merge.R                 54       0  100.00%
R/ui_containers.R            55       0  100.00%
R/zzz.R                       5       5  0.00%    3-11
TOTAL                      1423      92  93.53%

Diff against main

Filename            Stmts    Miss  Cover
----------------  -------  ------  -------
R/module_merge.R       -3       0  -0.01%
TOTAL                  -3       0  -0.01%

Results for commit: c1f2373

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Unit Tests Summary

  1 files   11 suites   18s ⏱️
275 tests 261 ✅ 14 💤 0 ❌
409 runs  394 ✅ 15 💤 0 ❌

Results for commit c1f2373.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
badge_dropdown 💀 $0.16$ $-0.16$ $-1$ $-1$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
assertion 👶 $+0.02$ unnamed
badge_dropdown 💀 $0.16$ $-0.16$ shinytest2_badge_dropdown_is_visible_when_clicking_on_it_multiple_times

Results for commit 68ede51

♻️ This comment has been updated with latest results.

@m7pr m7pr mentioned this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant