Skip to content

Fix destructuring of async load_contents results - #477

Merged
3v1n0 merged 1 commit into
ubuntu:mainfrom
OK1BR:fix-layouts-loading
Oct 8, 2026
Merged

3v1n0 merged 1 commit into
ubuntu:mainfrom
OK1BR:fix-layouts-loading

Conversation

@OK1BR

@OK1BR OK1BR commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

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 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

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>
@3v1n0

3v1n0 commented Oct 8, 2026

Copy link
Copy Markdown
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

@3v1n0
3v1n0 merged commit dae877f into ubuntu:main Oct 8, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v55: layouts never load ("No valid layouts defined") — async load_contents_async destructured like the sync call

2 participants