Skip to content

Fix back button when app is inside Cozy #3909

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

Merged
merged 1 commit into from
Aug 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions contact/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ packages:
dependency: transitive
description:
name: flutter_svg
sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1
url: "https://pub.dev"
source: hosted
version: "2.0.9"
version: "2.1.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -1233,26 +1233,26 @@ packages:
dependency: transitive
description:
name: vector_graphics
sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43"
sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.19"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7"
sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.13"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26
sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331"
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.17"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -1334,5 +1334,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"
20 changes: 10 additions & 10 deletions core/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ packages:
dependency: "direct main"
description:
name: flutter_svg
sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1
url: "https://pub.dev"
source: hosted
version: "2.0.9"
version: "2.1.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -1170,26 +1170,26 @@ packages:
dependency: transitive
description:
name: vector_graphics
sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43"
sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.19"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7"
sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.13"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26
sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331"
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.17"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -1271,5 +1271,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"
2 changes: 1 addition & 1 deletion core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
### Dependencies from pub.dev ###
cupertino_icons: 1.0.6

flutter_svg: 2.0.9
flutter_svg: 2.1.0

dio: 5.0.0

Expand Down
2 changes: 1 addition & 1 deletion cozy/lib/cozy_config_manager/cozy_config_manager_stub.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CozyConfigManager {
Future<void> injectCozyScript() async {
Future<void> injectCozyScript(String cozyExternalBridgeVersion) async {
throw UnimplementedError('Cannot use injectCozyScript in non-web environment');
}

Expand Down
4 changes: 2 additions & 2 deletions cozy/lib/cozy_config_manager/cozy_config_manager_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:linagora_design_flutter/cozy_config_manager/cozy_config_manager.
class CozyConfigManager {
bool? _isInsideCozy;

Future<void> injectCozyScript() async {
await cozy.CozyConfigManager().injectCozyScript();
Future<void> injectCozyScript(String cozyExternalBridgeVersion) async {
await cozy.CozyConfigManager().injectCozyScript(cozyExternalBridgeVersion);
}

Future<void> initialize() async {
Expand Down
102 changes: 99 additions & 3 deletions cozy/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
args:
dependency: transitive
description:
name: args
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
url: "https://pub.dev"
source: hosted
version: "2.7.0"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -126,6 +134,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.0"
flutter_svg:
dependency: transitive
description:
name: flutter_svg
sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845
url: "https://pub.dev"
source: hosted
version: "2.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -136,6 +152,22 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
name: http
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.1.2"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -165,7 +197,7 @@ packages:
description:
path: "."
ref: master
resolved-ref: "083cbf597cce8bedcc7ccda76a0c49eb06a71e9e"
resolved-ref: "17879a3de917152eb5473058ef2c3302d2c01f3e"
url: "https://github.com/linagora/linagora-design-flutter.git"
source: git
version: "0.0.1"
Expand Down Expand Up @@ -209,6 +241,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.0"
path_parsing:
dependency: transitive
description:
name: path_parsing
sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
permission_handler_platform_interface:
dependency: transitive
description:
Expand All @@ -217,6 +257,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.12.0"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.dev"
source: hosted
version: "6.0.2"
photo_manager:
dependency: transitive
description:
Expand Down Expand Up @@ -294,6 +342,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.3"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.4.0"
vector_graphics:
dependency: transitive
description:
name: vector_graphics
sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6
url: "https://pub.dev"
source: hosted
version: "1.1.19"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
url: "https://pub.dev"
source: hosted
version: "1.1.13"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331"
url: "https://pub.dev"
source: hosted
version: "1.1.17"
vector_math:
dependency: transitive
description:
Expand All @@ -310,6 +390,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "14.3.0"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
xml:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.dev"
source: hosted
version: "6.5.0"
sdks:
dart: ">=3.5.4 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"
2 changes: 1 addition & 1 deletion docs/adr/0061-cozy-integration-set-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ cozy-stack instances add tmail.localhost:8080 --passphrase cozy --apps home,stor
- Apply patchs/cozy-dev-config.patch
- Edit session url in jmap-dart-client to /jmap/session
- isInsideCozy will be `false` if run on localhost, so in cozy_config_web.dart, return true on isInsideCozy
- in `env.file`, COZY_INTEGRATION=true
- in `env.file`, COZY_INTEGRATION=true and COZY_EXTERNAL_BRIDGE_VERSION=x.x.x (where x.x.x is the version of cozy-external-bridge)
- `flutter run -d chrome --web-port 2023 --web-browser-flag "--disable-web-security" --profile`

3. Access Cozy
Expand Down
3 changes: 2 additions & 1 deletion env.file
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ IOS_FCM=supported
FORWARD_WARNING_MESSAGE=
PLATFORM=other
WS_ECHO_PING=
COZY_INTEGRATION=
COZY_INTEGRATION=
COZY_EXTERNAL_BRIDGE_VERSION=
2 changes: 2 additions & 0 deletions lib/main/utils/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ class AppConfig {
static bool get isWebSocketEchoPingEnabled => dotenv.get('WS_ECHO_PING', fallback: 'false') == 'true';

static bool get isCozyIntegrationEnabled => dotenv.get('COZY_INTEGRATION', fallback: 'false') == 'true';

static String get cozyExternalBridgeVersion => dotenv.get('COZY_EXTERNAL_BRIDGE_VERSION', fallback: '0.16.1');
}
2 changes: 1 addition & 1 deletion lib/main/utils/cozy_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CozyIntegration {

try {
final cozyConfig = CozyConfigManager();
await cozyConfig.injectCozyScript();
await cozyConfig.injectCozyScript(AppConfig.cozyExternalBridgeVersion);
await cozyConfig.initialize();
} catch (e) {
logError('CozyIntegration::integrateCozy:Exception = $e');
Expand Down
20 changes: 10 additions & 10 deletions model/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ packages:
dependency: transitive
description:
name: flutter_svg
sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1
url: "https://pub.dev"
source: hosted
version: "2.0.9"
version: "2.1.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -1210,26 +1210,26 @@ packages:
dependency: transitive
description:
name: vector_graphics
sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43"
sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.19"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7"
sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.13"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26
sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331"
url: "https://pub.dev"
source: hosted
version: "1.1.9+1"
version: "1.1.17"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -1311,5 +1311,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"
Loading
Loading