Commit 335601c
feat: respect BE network body limit (#593)
* feat: add network body max size APIs in Android
- Added `onNetworkLogBodyMaxSizeChange` method to `FeatureFlagsFlutterApi` in Dart.
- Implemented `getNetworkBodyMaxSize` method in `InstabugApi` to retrieve network log character limit.
- Updated `InstabugApiTest` with a new test for `getNetworkBodyMaxSize`.
* feat: add network body max size APIs in iOS
- Updated Instabug podspec to version 15.0.1.
- Added `getNetworkBodyMaxSize` method in `InstabugApi` for retrieving network log body size.
- Introduced a new test case for `getNetworkBodyMaxSize` in `InstabugApiTests`.
- Updated .gitignore files to include project-specific and Android-related paths.
* feat: add body size checks inside network manager and cache retrieved in feature flags manager
- Added `_networkBodyMaxSize` to `FeatureFlagsManager` for managing network body size limits.
- Introduced `didRequestBodyExceedSizeLimit` and `didResponseBodyExceedSizeLimit` methods in `NetworkManager` to validate request and response body sizes against the limit.
- Created `InstabugConstants` for standardized logging messages related to network body size limits.
- Implemented caching for network body size retrieval to optimize performance.
* feat: utilize network manager size checker APIs inside `network_logger.dart`
- Added early checks for request and response body size limits in `networkLogInternal`.
- Implemented truncation of request/response bodies with warning messages if size limits are exceeded.
- Logged truncation events using `InstabugLogger` for better visibility into network logging behavior.
* chore: add default value of 10KB as a fallback, add network body size specific tests
- Introduced a default network body max size of 10KB to improve logging consistency.
- Updated error handling to set the cached size to the default when native API retrieval fails.
- Added unit tests for `didRequestBodyExceedSizeLimit` and `didResponseBodyExceedSizeLimit` to ensure proper size limit checks for request and response bodies.
* chore: run `dart format .`, and add new `example/pubspec.lock`
* fix: reference the correct iOS SDK and the correct podfile setup
* fix: update network body max size handling and caching
- Changed the return type of `getNetworkBodyMaxSize` from `int?` to `double?` in the API and updated related method calls accordingly.
- Renamed `registerW3CFlagsListener` to `registerFeatureFlagsListener` for consistency across the codebase.
- Introduced a callback mechanism in `FeatureFlagsManager` to handle changes in network body max size, ensuring proper cache management in `NetworkManager`.
- Updated tests to reflect the new method names and ensure functionality remains intact.
* chore: update CHANGELOG to include backend network body size limit support
* fix: flutter and android tests
* fix: fix ios and flutter failing tests
* chore: run dart format
* fix: improve formatting to align with linter
* fix
* fix
* fix
---------
Co-authored-by: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com>1 parent 7eab68c commit 335601c
File tree
23 files changed
+540
-10
lines changed- .circleci
- packages
- instabug_dio_interceptor/test
- instabug_flutter
- android/src
- main/java/com/instabug/flutter/modules
- test/java/com/instabug/flutter
- example
- android
- ios
- InstabugTests
- ios/Classes
- Modules
- Util
- lib/src
- modules
- utils
- pigeons
- test
- instabug_http_client/lib
23 files changed
+540
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| |||
747 | 752 | | |
748 | 753 | | |
749 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
750 | 771 | | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
782 | 793 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
653 | 669 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments