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

Truncate large response body in legacy sandbox #1034

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

appurva21
Copy link
Member

Issue

When setting up the legacy sandbox, the response buffer is, by default, converted to a string to support the global variable responseBody. This negatively affects the script execution performance for consumers who are not even consuming this value.

Fix

The ideal fix for this would be to lazily initialize responseBody through a getter, but due to how Uniscope is implemented, it is not possible to achieve that without a significant refactoring there (TLDR; the getter would get called at multiple places inside Uniscope).

The second best approach is to truncate the responseBody if it is too large (50MB). Since this is a deprecated syntax, users can (and should) use pm.response.text() for their requirements.

@appurva21 appurva21 requested a review from codenirvana August 28, 2024 15:59
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.77%. Comparing base (91bbb44) to head (e5ea17c).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1034   +/-   ##
========================================
  Coverage    52.77%   52.77%           
========================================
  Files           12       12           
  Lines          612      612           
  Branches       146      146           
========================================
  Hits           323      323           
  Misses         249      249           
  Partials        40       40           
Flag Coverage Δ
unit 52.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@appurva21 appurva21 merged commit 1874841 into develop Sep 24, 2024
12 checks passed
@appurva21 appurva21 deleted the feature/legacy-sandbox-perf branch September 24, 2024 10:15
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.

2 participants