fix: template render error [INS-4962]#8338
Merged
filfreire merged 6 commits intoFeb 6, 2025
Merged
Conversation
ryan-willis
previously approved these changes
Feb 6, 2025
gatzjames
previously approved these changes
Feb 6, 2025
gatzjames
approved these changes
Feb 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes INS-4962. Changes:
insomnia/packages/insomnia/src/ui/components/codemirror/extensions/nunjucks-tags.ts
Lines 283 to 288 in b7e9597
pre-request-script-windowsmoke test to help test a better a fix in the future.context
The bug was introduced after
10.3.0due to the sanitization code we added in order to solve another bug (see 90bd25c#diff-28ee43a50d28cabb98317967663a3abd59d3e11c9fafa39bca88eed9d290c0b6R173).Something about the
variables.replaceIn(sanitizedRawUrl)call that happens on the insomnia sdk does not work well with this particular format of template tags{{ _['host_environment'] }}.notes
One important thing to note, is that the code-path to render template tags in
insomnia-sdkis a different one than the one we use on the app (for example for rendering the templates in the preview of the URL )insomnia/packages/insomnia/src/common/render.ts
Line 262 in b7e9597
insomnia/packages/insomnia-sdk/src/objects/interpolator.ts
Line 11 in b7e9597
We might want to consider merging both to make use of old edge case fixes we already have done before the sdk.
Another side-note is that to debug this issue is a bit tricky as it requires: