Skip to content

fix(viewer): fix two startup warnings surfaced by the log cleanup - #2979

Merged
vpetersson merged 1 commit into
masterfrom
fix/viewer-startup-warnings
Jun 2, 2026
Merged

fix(viewer): fix two startup warnings surfaced by the log cleanup#2979
vpetersson merged 1 commit into
masterfrom
fix/viewer-startup-warnings

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Two pre-existing viewer startup warnings that became visible once the debug-logging firehose was removed (#2977).

Description

1. migrate_legacy_paths.sh aborts on unbound $USER in-container. The script runs set -euo pipefail, and USER_HOME="${USER_HOME:-/home/${USER}}" references a bare $USER. In the viewer container (DATA mode, invoked via migrate_in_container_paths.sh) $USER is unset, so set -u aborts the script at that line — which on a legacy (screenly→anthias) device would skip the in-container migration entirely. Now falls back to id -un (${USER:-$(id -un)}) so it resolves without erroring. USER_HOME is only actually used in HOST mode; in DATA mode it just needs to not blow up.

2. AnthiasViewer shows its window twice. The MainWindow ctor called showFullScreen() and main() then called window->show(). Under cage/wayland (pi5/x86/arm64) that double surface-commit tripped wlroots' A configure is scheduled for an uninitialized xdg_surface warning at startup. The window is now shown exactly once, via showFullScreen() in main() after construction.

Both are warning/robustness fixes — no behavior change to normal playback.

Checklist

  • I have performed a self-review of my own code.
  • Unit tests / lint unaffected (shell + C++ webview only; bash -n clean).
  • End-to-end Pi test — the C++ change needs a webview rebuild; I'll confirm the wlroots warning is gone on the pi5 testbed once the image builds.
  • x86 — same cage/wayland path as pi5; covered by the show-once fix.
  • Documentation — N/A.

🤖 Generated with Claude Code

With debug logging removed (#2977), two pre-existing startup warnings
became visible in the viewer logs. Both are fixed here:

- migrate_legacy_paths.sh: `set -euo pipefail` + the bare `${USER}` in
  USER_HOME aborted the script when $USER is unset — which is the case
  in-container (DATA mode, via migrate_in_container_paths.sh). On a
  legacy (screenly→anthias) device that would skip the in-container
  migration entirely. Fall back to `id -un` so it resolves without
  tripping `set -u`.
- AnthiasViewer: the MainWindow ctor called showFullScreen() AND main()
  called window->show(), showing the window twice. Under cage/wayland
  the double surface-commit tripped wlroots' "A configure is scheduled
  for an uninitialized xdg_surface" warning at startup. Show once, in
  main(), after construction.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson requested a review from a team as a code owner June 2, 2026 16:57
@vpetersson vpetersson self-assigned this Jun 2, 2026
@vpetersson
vpetersson requested a review from Copilot June 2, 2026 16:58
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses two viewer startup warnings that became visible after reducing Qt debug logging, improving robustness in containerized startup and avoiding wlroots warnings under cage/Wayland.

Changes:

  • Avoids set -u aborts in migrate_legacy_paths.sh when $USER is unset in-container by falling back to id -un.
  • Ensures the Qt MainWindow is shown exactly once by moving showFullScreen() out of the constructor and into main().
  • Removes the redundant window->show() call that previously caused a double surface commit under cage/Wayland.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/anthias_webview/src/mainwindow.cpp Removes constructor-time showFullScreen() to avoid double-show behavior.
src/anthias_webview/src/main.cpp Shows the window fullscreen exactly once after construction.
bin/migrate_legacy_paths.sh Prevents unbound $USER failures under set -u by adding a safe fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson
vpetersson merged commit 576726d into master Jun 2, 2026
8 checks passed
@vpetersson vpetersson mentioned this pull request Jun 2, 2026
5 tasks
vpetersson added a commit that referenced this pull request Jun 2, 2026
- CalVer (YYYY.0M.MICRO); still June 2026, micro 0 -> 1
- Ships the QML VideoOutput presentation path (#2975), the pi2/pi3
  GStreamer HW video pipeline (#2972), and the x86 WLR_DRM_NO_ATOMIC
  display-freeze fix (#2978)
- Also picks up Pi 4 eglfs rotation (#2971, #2973), the armv7 viewer
  spawn retry (#2969), the Writeback-connector headless guard (#2968),
  and viewer log cleanups (#2977, #2979)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.

2 participants