Skip to content

Shorter SCANFI download errors that name the server that failed - #276

Merged
eliotmcintire merged 1 commit into
arbutus-scanfifrom
fix/scanfi-access-message
Oct 16, 2026
Merged

eliotmcintire merged 1 commit into
arbutus-scanfifrom
fix/scanfi-access-message

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

When a SCANFI download failed, LandR printed a long error that could give the wrong advice: someone who already had a mirror set up was told to turn the mirror on. The error is now about half as long, says whether Google Drive or the mirror refused the file, and only suggests settings that would actually change something.

Affects: the text of SCANFI download errors only; no download behaviour changes.

Technical details

.scanfiAccessMessage() (R/scanfi-access.R) chose between the Drive and mirror text with .remapsToMirror(), which returns FALSE whenever the user has their own reproducible.urlRemap. That user then got "check that ... getOption("reproducible.urlRemap") [is] non-NULL" and "permissions problem", even when their remap covered the file (the case where preProcess() ignored the remap, fixed in PredictiveEcology/reproducible#648).

Now: an error that mentions Google Drive is reported as a Drive access problem; otherwise a url the remap sends to the mirror is reported as a mirror (network) problem. For a V2 Drive failure the mirror bullet is "check that your reproducible.urlRemap covers this file" when the user has a remap, "set options(LandR.scanfiMirror = TRUE)" when the mirror is off, and absent when it was already on. Bullets are no longer wrapped, and the intro is one sentence.

Tests in test-scanfi-access.R and test-scanfiMirror.R updated, plus a new test of the three mirror-advice cases and of a Drive error on a url the mirror covers. This PR targets arbutus-scanfi (#274), where this message code lives; modsForFireSense will need it merged in too.

🤖 Generated with Claude Code

The message decided "Drive or mirror" from the options alone, so a
user with their own reproducible.urlRemap was told to check that
urlRemap is non-NULL (it was) and to enable LandR.scanfiMirror (it
was). It now reads the error: a Google Drive error is a Drive access
problem, otherwise a remapped V2 url is a mirror (network) problem.
The mirror advice names the setting that applies, and the message is
about half as long.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Oct 16, 2026
@eliotmcintire
eliotmcintire merged commit 06dc7dd into arbutus-scanfi Oct 16, 2026
1 check passed
@eliotmcintire
eliotmcintire deleted the fix/scanfi-access-message branch October 16, 2026 22:36
eliotmcintire added a commit that referenced this pull request Oct 16, 2026
Brings in #276: shorter SCANFI access errors that name the server that failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	NEWS.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant