Qt6 Webengine doesn't save cookies and caches
- While working on a python chart accessing map tiles from a tile server, I've noticed that caching isn't working
- Logins in webpage charts aren't remembered either.
Turns out, Webengine in Qt6 no longer creates a Default Profile and therefore neither caches nor cookies are stored.
https://forum.qt.io/topic/131277/qtwebengine-cannot-save-cache https://doc-snapshots.qt.io/qt6-dev/qtwebengine-changes-qt6.html#default-profile
This is definitely a preference for us- would rather not introduce unneccesary vulnerabilities and attack surfaces.
This is definitely a preference for us- would rather not introduce unneccesary vulnerabilities and attack surfaces.
Fair enough. Should probably be mentioned when we switch to qt6 since the behavior of web page charts will change.
We should still check for regressions. To me it looks like we depend on the profile in a few places:
grep -r QWebEngineProfile
deprecated/OAuthManager.h:#include <QWebEngineProfile>
src/Cloud/OAuthDialog.h:#include <QWebEngineProfile>
src/Train/LiveMapWebPageWindow.cpp://#include <QWebEngineProfile>
src/Train/MeterWidget.cpp:#include <QWebEngineProfile>
src/Train/WebPageWindow.cpp:#include <QWebEngineProfile>
src/Train/WebPageWindow.cpp: view->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);
I agree this is a better behavior for OAuth, for the Web Page chart I think we could make it opt in, requiring explicit enable in chart config since cookies are useful for automatic login, for example to download original files from Garmin Connect. No sure about the 3 maps and Python web chart.
No sure about the 3 maps and Python web chart.
I think having caching enabled for maps would be nice since we rely on volunteer driven projects like openstreetmap or opentopomap and their tile servers. It would take some pressure off their infrastructure and it would just be a friendly thing to do.
Even though I've discovered the issue while working on a python chart, I think for those it doesn't actually matter and might not be worth the effort.
I think you are right- we should look to enable caching for the map.