Skip to content

rsession-not-found startup error HTML-escapes the working directory #19546

Open

Description

@kevinushey

Summary

rsessionNotFoundError() in src/node/desktop/src/main/utils.ts builds its message with i18next.t('utilsTs.rsessionNotFoundError', { workingDirectory }). i18next HTML-escapes interpolated values by default (escapeValue: true), and i18n-manager.ts does not change that, so the working directory in the startup error reads like:

( Working directory: /Users/me/rstudio/src/node/desktop )

The message is shown in a native error dialog and logged, neither of which renders HTML, so the escaping is just noise in the one path the message is there to show.

Fix

Pass interpolation: { escapeValue: false } to the t() call, as gwt-callback.ts does for its interpolated paths and as #19501 now does for the desktop options reset dialog. Worth a quick sweep of the other i18next.t(...) calls in src/node/desktop/src/main that interpolate paths into native dialogs or log text.

Spotted while addressing review on #19501: the unit test that hits this error (findComponents returns session and scripts paths without RSTUDIO_CPP_BUILD_OUTPUT) prints the escaped path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions