fix(dashboard): show chart tooltip labels as text, and decode keys like the api does (24.05) - #7883
Open
ar2rsawseen wants to merge 1 commit into
Open
Conversation
…ke the api does (24.05) Backport of the master change. All three functions are identical on this branch, so the patch applied unchanged. sanitizeHtml encoded its input and then immediately unescaped it. Those two are inverses, so it returned the input unchanged and a label containing markup went into a tooltip template as markup rather than being shown as text. It now normalises first and escapes last: undo the html escaping the api applies, undo the key substitutions, then escape once. The dashboard's key decoder also undid only $ and . while the api encoder substitutes NUL as well and the api decoder accepts the url encoded forms, so ▯, &#36; and &#46; reached callers still encoded. Both directions of the dashboard pair now match the api. One visible consequence: a value containing NUL shows the character itself, which is invisible, where it previously showed the placeholder glyph the browser resolved ▯ into. Full unit suite on this branch: 101 passing before, 144 after, same 5 pre-existing failures (validateArgs extra types, Countly Request). eslint clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
Backport of #7882, which has the full write-up. All three functions are identical on this branch, so the patch applied unchanged.
sanitizeHtmlencoded its input and then immediately unescaped it. Those two are inverses, so it returned the input unchanged and a label containing markup went into a tooltip template as markup rather than being shown as text. It now normalises first and escapes last: undo the html escaping the api applies, undo the key substitutions, then escape once.Separately, the dashboard's key decoder undid only
$and.while the api encoder also substitutes NUL and the api decoder accepts the url encoded forms, so▯,&#36;and&#46;reached callers still encoded. Both directions of the dashboard pair now match the api.One visible consequence: a value containing NUL shows the character itself, which is invisible, where it previously showed the placeholder glyph the browser resolved
▯into. NUL in a key or segment value is pathological, and the alternative was leaving one of the two decoders knowingly incomplete.Verification
validateArgs extra types,Countly Request). Baseline captured by reverting and re-running.\u0000.🤖 Generated with Claude Code