Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File browser unable to handle directories containing non-UTF-8 file names in 4.0.0 #4118

Open
robinkar opened this issue Feb 4, 2025 · 0 comments
Milestone

Comments

@robinkar
Copy link
Contributor

robinkar commented Feb 4, 2025

There seems to have been a regression from 3.1.10 -> 4.0.0 with the display of non-UTF-8 files (see #2624 for previous issue).
This only happens for production environments (i.e. not development or test environment).

In 3.1.10 a directory with non-UTF-8 files will just ignore the files that can't be displayed:
Image

In 4.0.0 (local dev container here (i.e. nightly (/pun/sys/dashboard))), however, there is only the error message, and no files are shown at all:
Image

To reproduce this, you can create a file with non-UTF-8 name as described in #2624 and attempt to open the directory.

I noticed that there are indeed tests for this case, so I spent some time trying to figure out what is going on here, and it seems like this only happens in production (RAILS_ENV=production). With the dashboard app running as a sandbox app (RAILS_ENV=development) this works perfectly fine.

It seems that the OodAppKit LogFormatter is only enabled for production, which causes it to then run strip on the non-UTF-8 filename to log "Not showing file ... ".
A quick test in the terminal shows that this is indeed the case:

[rkarlsso@blahake ~]$ `ruby -e '"\xFF\u0001\u0002\u0003-ood-test-file".strip'`
-e:1:in `strip': invalid byte sequence in UTF-8 (ArgumentError)
	from -e:1:in `<main>'

I opened a PR in OSC/ood_appkit#73, but I'm wondering whether similar cases exist elsewhere due to test environment not matching the production environment (not necessarily limited to non-UTF-8 strings, but more generally).

@osc-bot osc-bot added this to the Backlog milestone Feb 4, 2025
@robinkar robinkar changed the title File browser unable to handle directories with non-UTF-8 file names in 4.0.0 File browser unable to handle directories containing non-UTF-8 file names in 4.0.0 Feb 4, 2025
@johrstrom johrstrom modified the milestones: Backlog, 4.0 Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants