From c49a6f9d5526fd0d3a5f5b817f864743573a6c23 Mon Sep 17 00:00:00 2001 From: Graham Williams Date: Fri, 11 Sep 2026 15:19:31 +1000 Subject: [PATCH 1/4] Updated templates --- .github/workflows/ci.yaml | 2 +- .lycheeignore | 2 ++ support/flutter.mk | 2 ++ support/update.sh | 16 ++++++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3f46e972..7f3c7ec3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ on: types: [opened, reopened, synchronize] env: - FLUTTER_VERSION: '3.47.0' + FLUTTER_VERSION: '3.47.3' jobs: diff --git a/.lycheeignore b/.lycheeignore index a68957c9..5ef06612 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -101,6 +101,8 @@ https://solid.dev.empwr.au/alice/profile/card#me https://solid.dev.empwr.au/Analyser https://www.heart.org/ https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings +https://solid.dev.empwr.au/bob/profile/card#me +https://snapcraft.io/healthpod # 20260605 gjw Failing solid servers diff --git a/support/flutter.mk b/support/flutter.mk index 8ea0ec51..27e79683 100644 --- a/support/flutter.mk +++ b/support/flutter.mk @@ -317,6 +317,8 @@ todo: license: @echo "Files without a LICENSE:\n" @-output=$$(find lib -type f -not -name '*~' -not -name 'README*' -not -name '*.g.dart' \ + -not -name '*.pb.dart' -not -name '*.pbenum.dart' \ + -not -name '*.pbjson.dart' -not -name '*.pbgrpc.dart' -not -name '*.proto' \ ! -exec grep -qE '^(///? Copyright|///? Licensed)' {} \; -print | xargs printf "\t%s\n"); \ if [ $$(echo "$$output" | wc -w) -ne 0 ]; then \ echo "$$output"; \ diff --git a/support/update.sh b/support/update.sh index d5fd6ad0..e36b3f5d 100644 --- a/support/update.sh +++ b/support/update.sh @@ -37,6 +37,22 @@ FILES=( ${SCRIPTS}Makefile Makefile ) +# 20260911 gjw The android build configuration is app independent: the +# app name only appears in android/app/build.gradle.kts (namespace, +# applicationId) which stays local. Sharing these keeps the gradle, +# AGP, and kotlin versions in step across all apps, which is what +# flutter's build dependency validation warns about. Only add them +# when the app builds for android. + +if [ -d android ]; then + FILES+=( + ${SCRIPTS}flutter/android/build.gradle.kts android/build.gradle.kts + ${SCRIPTS}flutter/android/settings.gradle.kts android/settings.gradle.kts + ${SCRIPTS}flutter/android/gradle.properties android/gradle.properties + ${SCRIPTS}flutter/android/gradle/wrapper/gradle-wrapper.properties android/gradle/wrapper/gradle-wrapper.properties + ) +fi + length=${#FILES[@]} for ((i=0; i < length; i+=2)); do From 3f040764f6bed4187fd39926fd69743985dfdd17 Mon Sep 17 00:00:00 2001 From: Graham Williams Date: Fri, 11 Sep 2026 15:36:01 +1000 Subject: [PATCH 2/4] Single-flight session restore so startup no longer clears the session --- CHANGELOG.md | 1 + lib/src/solid/utils/authdata_manager.dart | 31 ++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61027472..452788c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Visit the package at [pub.dev](https://pub.dev/packages/solidpod). ## 1.0 ++ Fix always being asked to log in again on startup [1.0.22 20260911 gjw] + Disable caching for web [1.0.21 20260908 jesscmoore] + Migrate oidc from 0->4 [1.0.20 20260904 gjw] + Update dependency (including rdf 1.0.0, renamed from rdflib) [1.0.19] diff --git a/lib/src/solid/utils/authdata_manager.dart b/lib/src/solid/utils/authdata_manager.dart index 81d8321f..0fbe92a7 100644 --- a/lib/src/solid/utils/authdata_manager.dart +++ b/lib/src/solid/utils/authdata_manager.dart @@ -87,18 +87,43 @@ class AuthDataManager { authStateNotifier.value = true; } + /// The restore currently in flight, shared by concurrent callers. + static Future? _restoreInFlight; + + /// The token refresh currently in flight, shared by concurrent callers. + static Future? _refreshInFlight; + /// Returns current [SolidAuthData], refreshing the token if expired. /// /// If no in-memory manager exists, attempts to restore the session from /// secure storage using [SolidAuthManager.initForIssuer]. Returns null /// when the session cannot be restored (forces re-login). - static Future loadAuthData() async { + /// + /// Concurrent callers share a single restore (and a single refresh) rather + /// than each starting their own. Both paths end in a `refresh_token` grant, + /// and the Solid server issues single-use refresh tokens: a second grant + /// sent with the same token is rejected as `invalid_grant`, and + /// [SolidAuthManager.tryRestoreSession] responds to that failure by clearing + /// the stored session — discarding the session the first caller had just + /// successfully refreshed. On startup two callers are routine (solidui's + /// auto-login and its login-status notifier both run on the first frame), + /// so without this the session is destroyed on every launch. + static Future loadAuthData() { // Check if live manager already in memory. if (_authManager != null) { - return _getRefreshedAuthData(_authManager!); + return _refreshInFlight ??= _getRefreshedAuthData( + _authManager!, + ).whenComplete(() => _refreshInFlight = null); } - // Slow path: try to restore from secure storage. + return _restoreInFlight ??= _restoreFromStorage().whenComplete( + () => _restoreInFlight = null, + ); + } + + /// Restores the session from secure storage. Call via [loadAuthData], which + /// ensures only one restore runs at a time. + static Future _restoreFromStorage() async { final dataStr = await secureStorage.read(key: _authDataSecureStorageKey); if (dataStr == null) return null; From 5b1c0596a6cee573971e07303f087edbf52aaf5c Mon Sep 17 00:00:00 2001 From: Graham Williams Date: Sat, 12 Sep 2026 05:33:43 +1000 Subject: [PATCH 3/4] Bump version 1.0.22 Fix always being asked to log in again on startup --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 36a23687..2dd0d06a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: solidpod description: Support access to private data from PODs on Solid servers. -version: 1.0.21 +version: 1.0.22 homepage: https://github.com/anusii/solidpod environment: @@ -35,7 +35,7 @@ dependencies: petitparser: ^7.0.2 pointycastle: ^4.0.0 rdf: ^1.0.0 - solid_auth: ^1.0.7 + solid_auth: ^1.0.8 universal_io: ^2.3.1 dev_dependencies: From 81c6ab7b25d34a58d26d80d6942e724993825328 Mon Sep 17 00:00:00 2001 From: Graham Williams Date: Sat, 12 Sep 2026 05:36:02 +1000 Subject: [PATCH 4/4] Bump version 1.0.22 Fix always being asked to log in again on startup --- pubspec.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pubspec.yaml b/pubspec.yaml index 2dd0d06a..5bd35379 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,6 +38,18 @@ dependencies: solid_auth: ^1.0.8 universal_io: ^2.3.1 +# 20260911 gjw TEMPORARY. The published solidpod and solid_auth clear the +# session on every start, so the login page always appears — see +# anusii/solidpod#717 and anusii/solid_auth#53. These overrides pick up the +# fixes from the GitHub fix branches. Remove this section once both are +# released. + +dependency_overrides: + solid_auth: + git: + url: https://github.com/anusii/solid_auth.git + ref: gjw/52_secure_token_store + dev_dependencies: build_runner: ^2.15.1 custom_lint: ^0.8.1