R CMD check sess fails in tests/tinytest.R after 7 passing tests:
test-ipc.R.................... 7 tests OK Error in page_res$rows[[1]][["1"]] : subscript out of bounds
Calls: <Anonymous> ... all.equal -> all.equal.character -> attr.all.equal -> mode
Execution halted
Cause
The dataview paging tests index rows as a list of row objects:
https://github.com/REditorSupport/vscode-R/blob/master/sess/inst/tinytest/test-ipc.R#L97
expect_equal(page_res$rows[[1]][["1"]], "3")
But dataview_rows() (sess/R/handlers.R:766) returns a data frame, so rows[[1]] is the first column, not the first row, and [["1"]] on that vector is out of bounds:
df <- data.frame(a = c(3, 1, 2), b = c("x", "y", "z"))
reg <- sess:::dataview_register(df)
p <- sess:::handle_dataview_page(list(
view_id = reg$view_id, startRow = 0L, endRow = 2L,
sortModel = list(), filterModel = list()
))
str(p$rows)
#> 'data.frame': 2 obs. of 3 variables:
#> $ 0: int 1 2
#> $ 1: num 3 1
#> $ 2: chr "x" "y"
The same pattern appears again at test-ipc.R:145 for the sort test.
The returned value looks correct: jsonlite serializes a data frame as an array of row objects, which is the shape the client consumes. So the tests' indexing appears to be what needs fixing, not dataview_rows(). Worth confirming against the client before changing either side.
Why CI didn't catch it
No workflow runs the sess tinytest suite. .github/workflows/main.yml only runs lintr::lint_package("sess") for this package; there is no R CMD check or tinytest step. Adding one would fit the test-coverage goals in #1732.
Other R CMD check findings
Fixed while investigating (uncommitted at time of writing):
httpgd used via ::/requireNamespace() but not declared → added to Suggests.
.lintr shipped inside the built package → added sess/.Rbuildignore.
Remaining NOTEs, not addressed:
getFromNamespace used without import; suggests importFrom("utils", "getFromNamespace").
::: calls into tools/utils internals (escapeAmpersand, print.help_files_with_topic, print.hsearch) and unlockBinding() in R/utils.R. These are inherent to how sess rebinds utils::View and hooks help rendering.
R CMD check sessfails intests/tinytest.Rafter 7 passing tests:Cause
The dataview paging tests index
rowsas a list of row objects:https://github.com/REditorSupport/vscode-R/blob/master/sess/inst/tinytest/test-ipc.R#L97
But
dataview_rows()(sess/R/handlers.R:766) returns a data frame, sorows[[1]]is the first column, not the first row, and[["1"]]on that vector is out of bounds:The same pattern appears again at
test-ipc.R:145for the sort test.The returned value looks correct: jsonlite serializes a data frame as an array of row objects, which is the shape the client consumes. So the tests' indexing appears to be what needs fixing, not
dataview_rows(). Worth confirming against the client before changing either side.Why CI didn't catch it
No workflow runs the
sesstinytest suite..github/workflows/main.ymlonly runslintr::lint_package("sess")for this package; there is noR CMD checkortinyteststep. Adding one would fit the test-coverage goals in #1732.Other
R CMD checkfindingsFixed while investigating (uncommitted at time of writing):
httpgdused via::/requireNamespace()but not declared → added toSuggests..lintrshipped inside the built package → addedsess/.Rbuildignore.Remaining NOTEs, not addressed:
getFromNamespaceused without import; suggestsimportFrom("utils", "getFromNamespace").:::calls intotools/utilsinternals (escapeAmpersand,print.help_files_with_topic,print.hsearch) andunlockBinding()inR/utils.R. These are inherent to howsessrebindsutils::Viewand hooks help rendering.