Fix panic when trying to get folder size without needed permissions#532
Merged
Conversation
✅ Deploy Preview for superfile canceled.
|
Owner
|
LGTM! |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Jan 6, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [yorukot/superfile](https://github.com/yorukot/superfile) | patch | `v1.1.6` -> `v1.1.7` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>yorukot/superfile (yorukot/superfile)</summary> ### [`v1.1.7`](https://github.com/yorukot/superfile/blob/HEAD/changelog.md#v117) [Compare Source](yorukot/superfile@v1.1.6...v1.1.7) > 2024-01-05 ##### Update - OneDark Theme added [`#477`](yorukot/superfile#477) - Add keys PageUp and PageDown for better navigation [`#498`](yorukot/superfile#498) - Add hotkey for copying PWD to clipboard [`#510`](yorukot/superfile#510) - Add desktop entry [`#501`](yorukot/superfile#501) - Enable cd_on_quit when current directory is home directory [`#518`](yorukot/superfile#518) - Edit superfile config [`#509`](yorukot/superfile#509) ##### Bug fix - Fix rendering directory symlinks as directories, not files [`#481`](yorukot/superfile#481) - Fix opening files on Windows [`#496`](yorukot/superfile#496) - Fix lag in dotfile toggle with multiple panels [`#499`](yorukot/superfile#499) - Fix parent directory navigation on Windows [`#502`](yorukot/superfile#502) - Fix panic when deleting last file in directory [`#529`](yorukot/superfile#529) - Fix panic when scrolling through an empty metadata list [`#531`](yorukot/superfile#531) - Fix panic when trying to get folder size without needed permissions [`#532`](yorukot/superfile#532) - Fix lag when navigating directories with large image files [`#525`](yorukot/superfile#525) - Fix typo in welcome message [`#494`](yorukot/superfile#494) ##### Optimization - Optimize file move operation [`#522`](yorukot/superfile#522) - Optimize file extraction [`#524`](yorukot/superfile#524) - Warn overwrite when renaming files [`#526`](yorukot/superfile#526) - Work without trash [`#527`](yorukot/superfile#527) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45MC40IiwidXBkYXRlZEluVmVyIjoiMzkuOTAuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check error on file info before getting its size.
When traversing directories, some of them might have the execute bit unset, which means you cant access its files (thus their sizes). Apparently trying to directly access the file info would cause a panic (on the OS side i think) which crashed the application. Checking for any errors before that solves the issue.
For now I just did not add the unreachable file size to the sum, which would lead to an incorrect size displayed to the user. Maybe displaying
FileSize: undefined, or insufficient permissions, or not showing them at all would be better. If that's the case, would be happy to change that too.Fixes #486