fix: prevent 'undefined' from appearing as text in issue descriptions#94
Closed
srubin wants to merge 3 commits into
Closed
fix: prevent 'undefined' from appearing as text in issue descriptions#94srubin wants to merge 3 commits into
srubin wants to merge 3 commits into
Conversation
When catalogFile is undefined, Handlebars was outputting the literal string 'undefined' instead of an empty string. This occurred because the custom escapeExpression override to disable HTML escaping didn't handle null/undefined values properly. The fix updates escapeExpression in both Linear and GitHub issue description modules to return an empty string for null/undefined values, preventing 'undefined' from appearing in generated issues. Fixes issue where catalog file path showed as 'undefined' when a provider has supportsCatalog=true but catalogFile is missing. Co-authored-by: Steve Rubin <srubin@users.noreply.github.com>
Co-authored-by: Steve Rubin <srubin@users.noreply.github.com>
Co-authored-by: Steve Rubin <srubin@users.noreply.github.com>
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.
TL;DR
Fixes a bug where the literal string
"undefined"appeared in Linear and GitHub issue descriptions when a dependency provider hadsupportsCatalog=truebut nocatalogFilewas set. Now correctly outputs an empty string instead.Why
When generating issue descriptions, Handlebars was configured with a custom
escapeExpressionfunction to disable HTML escaping (since the output is Markdown). However, this override didn't handlenull/undefinedvalues properly, causing Handlebars to output the literal string"undefined"instead of an empty string.This manifested in Linear issues like BIX-8345 where the "How to Update" section showed:
instead of an empty string when catalogFile was missing.
Code changes
escapeExpressionin bothsrc/linear/issueDescriptions.tsandsrc/github-issues/issueDescriptions.tsto handle null/undefined values by returning an empty stringundefinedcatalogFile values don't output the string "undefined"Testing
Related: Linear issue BIX-8345
Fun fact: This bug was as elusive as a duck hiding in tall reeds. Now flushed out and fixed! 🦆
Linear Issue: BIX-8345