Skip to content

fix: correct tryCatch handler signature and make flow-typed install non-fatal#105

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/automated-fix-reactlog-package-checks
Closed

fix: correct tryCatch handler signature and make flow-typed install non-fatal#105
Copilot wants to merge 2 commits intomainfrom
copilot/automated-fix-reactlog-package-checks

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 27, 2026

Two distinct CI failures on main are addressed here: a broken tryCatch error handler that surfaces only when shiny is absent (e.g. check-depends-only mode), and a postinstall.sh step that hard-fails whenever the flow-typed GitHub cache fetch encounters an API error.

Changes

  • R/shinyModule.Rtest_shiny_version() used error = function() with no parameters. R passes the caught condition as the first argument to handlers; a zero-parameter handler throws unused argument (cond) instead of returning FALSE. Only manifests when shiny is not installed (Suggests, not Imports).
# before
tryCatch({ ... }, error = function() { FALSE })

# after
tryCatch({ ... }, error = function(e) { FALSE })
  • bin/postinstall.shflow-typed install fetches a type-definition cache from the GitHub API; transient failures (rate limits, network errors) caused the entire yarn install to abort. Appended || true to make it non-fatal.
yarn flow-typed install --skip true --ignoreDeps dev || true

Note: The third failure (macOS-latest (4.6.0) — HTTP 404 downloading R) is a transient CRAN publishing lag: R 4.6.0 was released 2026-04-24 and the macOS binary was not yet available when the check ran three days later. No code change needed.

…on-fatal

- R/shinyModule.R: fix `error = function()` -> `error = function(e)` in
  `test_shiny_version()`. The handler must accept the condition argument
  passed by tryCatch, otherwise R throws "unused argument (cond)" when
  shiny is unavailable (e.g. in check-depends-only mode).

- bin/postinstall.sh: append `|| true` to `flow-typed install` so that
  transient GitHub API failures during cache fetch don't abort the
  postinstall script and block the routine CI job.

Agent-Logs-Url: https://github.com/rstudio/reactlog/sessions/b3ba1985-0e25-4de9-9e09-23b064266fe3

Co-authored-by: karangattu <4220325+karangattu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing package checks for reactlog on main fix: correct tryCatch handler signature and make flow-typed install non-fatal Apr 27, 2026
Copilot AI requested a review from karangattu April 27, 2026 20:29
@karangattu
Copy link
Copy Markdown
Contributor

Closing as a duplicate Copilot draft. Keeping #103 as the canonical PR for the package-check failure tracked in #102.

@karangattu karangattu closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated fix: reactlog package checks failing on main

2 participants