Repository navigation
Fix destructuring of async load_contents results - #477
Merged
Merged
Conversation
The promisified Gio.File.load_contents_async() resolves to
[contents, etag], unlike the sync load_contents(), which returns
[ok, contents, etag]. Both callers took the second element, i.e. the
etag string, so TextDecoder.decode() threw:
- Util._reloadLayouts(): the error was swallowed, so no layouts were
ever loaded ("No valid layouts defined").
- _loadAfterSessionLock(): the tiled state wasn't restored after
unlocking the screen and the error was logged instead.
Also log unexpected errors when (re)loading the layouts instead of
silently dropping them, so problems like this are visible.
Fixes ubuntu#475
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Thanks I had done the same locally for a while but it's basically the same, so let's go with this. I'll do some follow-up with the rest |
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.
The promisified
Gio.File.load_contents_async()resolves to[contents, etag], unlike the syncload_contents(), which returns[ok, contents, etag]. Both callers took the second element, i.e. the etag string, soTextDecoder.decode()threw:Util._reloadLayouts(): the error was swallowed, so no layouts were loaded at all ("No valid layouts defined" in the panel menu, the layout shortcuts and the favorite layout did nothing)._loadAfterSessionLock(): the tiled state wasn't restored after unlocking the screen and the error was logged after every unlock.This also logs unexpected errors when (re)loading the layouts instead of silently dropping them, so a problem like this shows up in the journal. A missing layouts file is still not logged, since it just means that no layouts were defined yet.
Tested on Arch Linux, GNOME Shell 50.5 (Wayland), gjs 1.88.1, GLib 2.88.3: the layouts are loaded again and there is no error after unlocking the screen anymore.
Fixes #475
🤖 Generated with Claude Code