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

Qt 6 reprise #189

Merged
merged 7 commits into from
Oct 18, 2024
Merged

Qt 6 reprise #189

merged 7 commits into from
Oct 18, 2024

Conversation

knuton
Copy link
Member

@knuton knuton commented Oct 17, 2024

This reverts the Qt 6 revert (#169) and makes the necessary changes to allow for persistent profiles, including using those created by a previous Qt 5 installation.

Checklist

  • Changelog updated
  • Code documented
  • User manual updated

This reverts commit a524d7a, reversing
changes made to 762787d.
In Qt6, enum values have been namespaced with the enum type.

This handler has been added after the previous attempt at migrating to
Qt6.
In Qt 6 the default behaviour was changed to create off-the-record
profiles, which are not written to disk. In order to obtain persistent
profiles again, we explicitly create a profile named "Default", which
matches the default naming in Qt 5.

We unset the page when the app is closed, to avoid the following warning
due to page and profile being torn down in the wrong order:

    Release of profile requested but WebEnginePage still not deleted. Expect troubles !
We previously let the app name be inferred from the name of the
executable, but this is brittle and caused a rename when the Nix Qt
wrapper configuration was changed.

We explicitly set the app name to "kiosk-browser", which is what was
the previously inferred name with the wrapped executable.

This is important to preserve earlier cache and storage locations which
are derived from the app name, see
https://doc.qt.io/qt-6/qstandardpaths.html
@knuton
Copy link
Member Author

knuton commented Oct 17, 2024

The e2e tests for kiosk persistence fail at 59e295c, but pass with the profile fix in 1753ea2.

fda922b should then additionally allow two-way compatibility with profiles created with a previous Qt 5 kiosk.

@knuton
Copy link
Member Author

knuton commented Oct 17, 2024

Checked Qt5->Qt6 session persistence with https://dist.dividat.com/releases/playos/develop/2024.7.0-DEVELOP/playos-installer-2024.7.0-DEVELOP.iso as Qt 5 installation, which updates itself to https://dist.dividat.ch/releases/playos/develop/2024.10.0-SNAPSHOT/playos-installer-2024.10.0-SNAPSHOT.iso (viz, the associated bundle), built and released from fda922b.

After creating the session in the Qt5 system, and updating to the Qt6 system, the session is persisted. Switching back to the Qt5 system then after having booted into the Qt6 system, the session is still usable.

@knuton knuton requested a review from guyonvarch October 17, 2024 13:39
@knuton knuton added the reviewable Ready for initial or iterative review label Oct 17, 2024
@knuton knuton marked this pull request as ready for review October 17, 2024 13:39
timeout=10
)

# Ideally here we would check if starting the kiosk resulted in a request
Copy link
Collaborator

Choose a reason for hiding this comment

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

Accidentally spotted this, but this is quite easily doable by e.g. setting up tinyproxy on the other VM and checking tinyproxy's logs:

services.tinyproxy.enable = true;
services.tinyproxy.settings = let
update_host_port = builtins.head
(builtins.match "https?://([^/]+)/?" updateUrl);
captive_host_port = builtins.head
(builtins.match "https?://([^/]+)/?" captivePortalUrl);
in {
Port = 8888;
Listen = "0.0.0.0";
Upstream = [
''http 127.0.0.1:80 "${update_host_port}"''
''http 127.0.0.1:80 "${captive_host_port}"''
];
LogLevel = "Critical"; # comment out to debug proxied reqs
};

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah, thanks for the input.

The problem as I recall had not been inspecting the proxy, but getting the playos peer to resolve the names. I don't recall all details now, but think you may have found a solution in your recent tests, so it's time to look at this again.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, your technique applies, I added back the full test based on that. 🙏

@knuton
Copy link
Member Author

knuton commented Oct 18, 2024

@guyonvarch The e2e failure was unrelated and disappeared on re-run. May be a flaky test, but unrelated to this change as far as I can tell.

Copy link
Member

@guyonvarch guyonvarch left a comment

Choose a reason for hiding this comment

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

👍

Tests:

  • Session is kept locally from Qt5 to Qt6,
  • Session is kept locally from Qt6 to Qt5,
  • Games work normally,
  • Long press on the menu key opens Playos settings

@guyonvarch guyonvarch merged commit 8076506 into dividat:main Oct 18, 2024
8 checks passed
@guyonvarch guyonvarch removed the reviewable Ready for initial or iterative review label Oct 18, 2024
@knuton knuton deleted the qt-6-reprise branch October 18, 2024 14:40
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.

3 participants