Skip to content
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

Limit Network text view to 2^16 characters to prevent it from crashing #6254

Merged
merged 7 commits into from
Aug 29, 2023

Conversation

CoderDake
Copy link
Contributor

@CoderDake CoderDake commented Aug 25, 2023

For images, the request and response bodies can get large which cause the Text view to hang DevTools.

I've hardcoded the 2^16 character limit for now, but I could be persuaded to allow an override in case other textviews have different needs.

Fixes #5973

Examples

Truncated

Screenshot 2023-08-25 at 3 47 54 PM

Under Character Limit

Screenshot 2023-08-25 at 3 47 58 PM

@bkonyi
Copy link
Contributor

bkonyi commented Aug 28, 2023

I'm fine with this for now, but I think this warrants further investigation as to why it causes a hang. We shouldn't have an issue rendering 2^16 characters. Can you file an issue to follow up on this?

@CoderDake CoderDake requested a review from bkonyi August 28, 2023 15:26
packages/devtools_app/lib/src/shared/common_widgets.dart Outdated Show resolved Hide resolved
NetworkResponseViewType.text => Text(
responseBody,
// Using TextViewer fixes
// https://github.com/flutter/devtools/issues/5973
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above issue should be closed when this PR lands, but I'd file a new issue for this as it's a bandaid fix if we don't know why we're seeing the hang in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CoderDake CoderDake merged commit 0ff0b58 into flutter:master Aug 29, 2023
13 of 15 checks passed
@CoderDake CoderDake deleted the fix-large-text-crash branch August 29, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Network tab freezes VSCode when displaying base64 image encoded strings
2 participants