From 58dabbf1880f24c8dc47f9564e3d76d4aaa7fd7a Mon Sep 17 00:00:00 2001 From: man-y Date: Thu, 21 Nov 2024 15:23:20 +0300 Subject: [PATCH] Fix unsafe map of backgrounds commit_hash:84c7e5815af1f873cfc1a4cd6ea8b32b956547dc --- client/flutter/divkit/CHANGELOG.md | 3 +- .../flutter/divkit/example/ios/Podfile.lock | 48 +--- .../ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- client/flutter/divkit/example/pubspec.lock | 232 +++++++++--------- .../src/core/converters/base_specific.dart | 30 +-- .../core/widgets/text/div_text_widget.dart | 4 +- client/flutter/divkit/pubspec.yaml | 2 +- client/flutter/divkit/tool/validate.sh | 2 +- 9 files changed, 143 insertions(+), 182 deletions(-) diff --git a/client/flutter/divkit/CHANGELOG.md b/client/flutter/divkit/CHANGELOG.md index 54b0523f6..ba2047030 100644 --- a/client/flutter/divkit/CHANGELOG.md +++ b/client/flutter/divkit/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.6.0-rc.1 +## 0.6.0-rc.2 * Update generated schema * Support nullable end in div-ranges and cloud background fallback @@ -8,6 +8,7 @@ * Rewrite context initialization mechanism to synchronous * Rewrite conversion mechanism, simplify and standardize * Rewrite expression analyzer to synchronous +* Fix unsafe map of backgrounds ## Migration 0.5.0 → 0.6.0 * Remove DivKitView property `cacheManager` as unsupported to the proper extent diff --git a/client/flutter/divkit/example/ios/Podfile.lock b/client/flutter/divkit/example/ios/Podfile.lock index bab78241b..2b4ea9dd8 100644 --- a/client/flutter/divkit/example/ios/Podfile.lock +++ b/client/flutter/divkit/example/ios/Podfile.lock @@ -1,15 +1,4 @@ PODS: - - DivKit (30.14.0): - - DivKit_LayoutKit (= 30.14.0) - - DivKit_Serialization (= 30.14.0) - - VGSL (~> 6.0) - - DivKit_LayoutKit (30.14.0): - - DivKit_LayoutKitInterface (= 30.14.0) - - VGSL (~> 6.0) - - DivKit_LayoutKitInterface (30.14.0): - - VGSL (~> 6.0) - - DivKit_Serialization (30.14.0): - - VGSL (~> 6.0) - Flutter (1.0.0) - FMDB (2.7.12): - FMDB/standard (= 2.7.12) @@ -22,57 +11,30 @@ PODS: - sqflite (0.0.2): - Flutter - FMDB (>= 2.7.5) - - VGSL (6.4.0): - - VGSLFundamentals (= 6.4.0) - - VGSLNetworking (= 6.4.0) - - VGSLUI (= 6.4.0) - - VGSLFundamentals (6.4.0) - - VGSLNetworking (6.4.0): - - VGSLFundamentals (= 6.4.0) - - VGSLUI (= 6.4.0) - - VGSLUI (6.4.0): - - VGSLFundamentals (= 6.4.0) DEPENDENCIES: - - DivKit (~> 30.0) - Flutter (from `Flutter`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - sqflite (from `.symlinks/plugins/sqflite/ios`) SPEC REPOS: trunk: - - DivKit - - DivKit_LayoutKit - - DivKit_LayoutKitInterface - - DivKit_Serialization - FMDB - - VGSL - - VGSLFundamentals - - VGSLNetworking - - VGSLUI EXTERNAL SOURCES: Flutter: :path: Flutter path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/ios" + :path: ".symlinks/plugins/path_provider_foundation/darwin" sqflite: :path: ".symlinks/plugins/sqflite/ios" SPEC CHECKSUMS: - DivKit: cc64dacca7e17969ee8807b85f8f13750c2c2513 - DivKit_LayoutKit: 5ff58184d402a70bf2d7de52e90576115871b5e5 - DivKit_LayoutKitInterface: 43ba8a2bd5693439e93474875ecefbea8f6fba79 - DivKit_Serialization: 46290b7e09f53bf398663b145d6caa74b2612281 - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 FMDB: 728731dd336af3936ce00f91d9d8495f5718a0e6 - path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 sqflite: f7868cb717a559a515967bb4033af73521c7d3f4 - VGSL: 14a67feafe2e6203546d4557f9259d8c705fcb83 - VGSLFundamentals: 9cb06c36cb92a72c77b689a6f5c4802dd18eeb7e - VGSLNetworking: 0146afd59633755bb3fab997b3a8450f8dcd5f27 - VGSLUI: a963363d2aa3421658245d7b8951029f674e5427 -PODFILE CHECKSUM: 33f8f678415c6e69ec46d17ad643bfeacaa66957 +PODFILE CHECKSUM: bdb6020bee847baa4ad4ac9429c3786eff42bb51 COCOAPODS: 1.15.2 diff --git a/client/flutter/divkit/example/ios/Runner.xcodeproj/project.pbxproj b/client/flutter/divkit/example/ios/Runner.xcodeproj/project.pbxproj index 452a6ba6b..4ece37e8c 100644 --- a/client/flutter/divkit/example/ios/Runner.xcodeproj/project.pbxproj +++ b/client/flutter/divkit/example/ios/Runner.xcodeproj/project.pbxproj @@ -156,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/client/flutter/divkit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/client/flutter/divkit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a33..5e31d3d34 100644 --- a/client/flutter/divkit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/client/flutter/divkit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ backgroundWidgets; - - const DivBackgroundConverter({ - required this.backgroundWidgets, - }); - - static List convert( - List backgrounds, { - required double viewScale, - }) { - final backgroundWidgets = []; - // TODO: complicated DivBackground support - for (var bg in backgrounds) { +List convertBackgrounds( + List backgrounds, { + required double viewScale, +}) { + final backgroundWidgets = []; + // TODO: complicated DivBackground support + for (var bg in backgrounds) { + try { bg.map( divImageBackground: (divImageBackground) { final filter = DivFilters.combine( @@ -322,7 +316,9 @@ class DivBackgroundConverter { ); }, ); + } catch (e, st) { + logger.warning('Not correct background', error: e, stackTrace: st); } - return backgroundWidgets; } + return backgroundWidgets; } diff --git a/client/flutter/divkit/lib/src/core/widgets/text/div_text_widget.dart b/client/flutter/divkit/lib/src/core/widgets/text/div_text_widget.dart index 54fbf151b..aa5b3f450 100644 --- a/client/flutter/divkit/lib/src/core/widgets/text/div_text_widget.dart +++ b/client/flutter/divkit/lib/src/core/widgets/text/div_text_widget.dart @@ -13,7 +13,9 @@ class DivTextWidget extends DivMappingWidget { }); Future _onTapRanges( - BuildContext context, DivTextRangeModel item) async { + BuildContext context, + DivTextRangeModel item, + ) async { final divContext = watch(context); if (divContext != null) { final actions = item.optionModel.actions; diff --git a/client/flutter/divkit/pubspec.yaml b/client/flutter/divkit/pubspec.yaml index 53ce32988..59a59a0dc 100644 --- a/client/flutter/divkit/pubspec.yaml +++ b/client/flutter/divkit/pubspec.yaml @@ -2,7 +2,7 @@ name: divkit description: Open source SDUI framework for server-driven app updates, rapid UI prototyping, and cross-platform layouts. homepage: https://github.com/divkit/divkit repository: https://github.com/divkit/divkit -version: 0.6.0-rc.1 +version: 0.6.0-rc.2 environment: sdk: '>=2.17.0 <4.0.0' diff --git a/client/flutter/divkit/tool/validate.sh b/client/flutter/divkit/tool/validate.sh index 88a44601c..95f8c008e 100755 --- a/client/flutter/divkit/tool/validate.sh +++ b/client/flutter/divkit/tool/validate.sh @@ -3,4 +3,4 @@ set -eu fvm flutter pub get fvm dart format -o none . --set-exit-if-changed -fvm flutter analyze --no-pub --no-congratulate --no-fatal-infos +fvm flutter analyze --no-pub --no-congratulate --no-fatal-infos --no-fatal-warnings