Skip to content

Commit a332538

Browse files
Release:16.0.4 (#645)
* Release: 16.0.4 * Release: 16.0.4 * Release: 16.0.4
1 parent 964d0d1 commit a332538

File tree

7 files changed

+38
-22
lines changed

7 files changed

+38
-22
lines changed

.circleci/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,7 @@ workflows:
415415
name: test_flutter-2.10.5
416416
version: 2.10.5
417417
app-dir: "~/project/packages/instabug_flutter/"
418-
- e2e_android_captain
419418
- test_ios
420-
- e2e_ios_captain
421419
- format_flutter
422420
- lint_flutter:
423421
requires:

packages/instabug_flutter/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [16.0.4](https://github.com/Instabug/Instabug-Flutter/compare/v16.0.2...dev) (Nov 16, 2025)
4+
5+
### Fixed
6+
7+
- Guard LuciqNavigatorObserver pending-step removal to eliminate the race that could crash apps or produce incorrect screenshots during rapid route transitions. ([#637](https://github.com/Instabug/Instabug-Flutter/pull/637))
8+
39
## [16.0.3](https://github.com/Instabug/Instabug-Flutter/compare/v16.0.2...dev) (Sep 9, 2025)
410

511
### Fixed

packages/instabug_flutter/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.instabug.flutter'
2-
version '16.0.2'
2+
version '16.0.4'
33

44
buildscript {
55
repositories {

packages/instabug_flutter/example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PODS:
22
- Flutter (1.0.0)
33
- Instabug (16.0.3)
4-
- instabug_flutter (16.0.2):
4+
- instabug_flutter (16.0.4):
55
- Flutter
66
- Instabug (= 16.0.3)
77
- OCMock (3.6)
@@ -31,7 +31,7 @@ EXTERNAL SOURCES:
3131
SPEC CHECKSUMS:
3232
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
3333
Instabug: b6290ceceb5d98966aa6f10fbd7970026a916f65
34-
instabug_flutter: 967085aa6daf0cd13a20e469aad38847e8421eb3
34+
instabug_flutter: 462e49dc4106bbe6c04c10c733b38d959f28bd40
3535
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
3636
video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b
3737

packages/instabug_flutter/ios/instabug_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'instabug_flutter'
3-
s.version = '16.0.2'
3+
s.version = '16.0.4'
44
s.summary = 'Flutter plugin for integrating the Instabug SDK.'
55
s.author = 'Instabug'
66
s.homepage = 'https://www.instabug.com/platforms/flutter'

packages/instabug_flutter/lib/src/utils/instabug_navigator_observer.dart

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import 'package:instabug_flutter/src/utils/screen_loading/screen_loading_manager
88
import 'package:instabug_flutter/src/utils/screen_name_masker.dart';
99

1010
class InstabugNavigatorObserver extends NavigatorObserver {
11+
InstabugNavigatorObserver({Duration? screenReportDelay})
12+
: _screenReportDelay =
13+
screenReportDelay ?? const Duration(milliseconds: 100);
14+
15+
final Duration _screenReportDelay;
1116
final List<InstabugRoute> _steps = [];
1217

1318
void screenChanged(Route newRoute) {
@@ -24,22 +29,29 @@ class InstabugNavigatorObserver extends NavigatorObserver {
2429
);
2530
//ignore: invalid_null_aware_operator
2631
WidgetsBinding.instance?.addPostFrameCallback((_) async {
27-
// Starts a the new UI trace which is exclusive to screen loading
28-
ScreenLoadingManager.I.startUiTrace(maskedScreenName, screenName);
29-
// If there is a step that hasn't been pushed yet
30-
if (_steps.isNotEmpty) {
31-
await reportScreenChange(_steps.last.name);
32-
// Report the last step and remove it from the list
33-
_steps.removeLast();
34-
}
32+
try {
33+
// Starts a the new UI trace which is exclusive to screen loading
34+
ScreenLoadingManager.I.startUiTrace(maskedScreenName, screenName);
35+
// If there is a step that hasn't been pushed yet
36+
final pendingStep = _steps.isNotEmpty ? _steps.last : null;
37+
if (pendingStep != null) {
38+
await reportScreenChange(pendingStep.name);
39+
// Remove the specific pending step regardless of current ordering
40+
_steps.remove(pendingStep);
41+
}
3542

36-
// Add the new step to the list
37-
_steps.add(route);
43+
// Add the new step to the list
44+
_steps.add(route);
3845

39-
// If this route is in the array, report it and remove it from the list
40-
if (_steps.contains(route)) {
41-
await reportScreenChange(route.name);
42-
_steps.remove(route);
46+
// If this route is in the array, report it and remove it from the list
47+
if (_steps.contains(route)) {
48+
await reportScreenChange(route.name);
49+
_steps.remove(route);
50+
}
51+
} catch (e) {
52+
InstabugLogger.I
53+
.e('Reporting screen change failed:', tag: Instabug.tag);
54+
InstabugLogger.I.e(e.toString(), tag: Instabug.tag);
4355
}
4456
});
4557
} catch (e) {
@@ -50,7 +62,7 @@ class InstabugNavigatorObserver extends NavigatorObserver {
5062

5163
Future<void> reportScreenChange(String name) async {
5264
// Wait for the animation to complete
53-
await Future.delayed(const Duration(milliseconds: 100));
65+
await Future.delayed(_screenReportDelay);
5466

5567
Instabug.reportScreenChange(name);
5668
}

packages/instabug_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: instabug_flutter
2-
version: 16.0.3
2+
version: 16.0.4
33
description: >-
44
Instabug empowers mobile teams to monitor, prioritize, and debug
55
performance and stability issues throughout the app development lifecycle.

0 commit comments

Comments
 (0)