fix: subscription entries not appearing after 3 additions in History tab#208
Merged
vakovalskii merged 1 commit intomainfrom May 6, 2026
Merged
fix: subscription entries not appearing after 3 additions in History tab#208vakovalskii merged 1 commit intomainfrom
vakovalskii merged 1 commit intomainfrom
Conversation
- Clear _analyticsHtmlCache in addSubEntry/removeSubEntry so render() always rebuilds the HTML from current localStorage, not the stale cache - Replace service/plan <select> dropdowns with <input>+<datalist> to allow adding any custom service (GitHub Copilot, Windsurf, etc.) - Auto-fill price on known service+plan combo via oninput with case-insensitive match; reset price when service changes - Fix stored XSS: e.from was rendered into innerHTML without escaping - Add color-scheme: dark to :root so datalist popup matches dark theme - Widen service input to 180px to fit longer service names - Add aria-label to all form inputs - Include service name in breakdown label for multi-subscription clarity
vakovalskii
approved these changes
May 6, 2026
Owner
vakovalskii
left a comment
There was a problem hiding this comment.
LGTM — clean fix with good explanation of root cause. CI green across Ubuntu/macOS × Node 18/20/22. Includes a nice XSS hardening as a bonus.
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.
Root cause
addSubEntry()andremoveSubEntry()calledrender()→renderAnalytics(), which has an HTML cache (_analyticsHtmlCache). The cache was never invalidated on subscription mutations — it was only cleared byloadSessions()(triggered by auto-refresh while cursor sessions were loading, roughly 2–3 times on startup). New entries were saved tolocalStoragecorrectly but the old cached HTML was shown instead. This gave the impression of a hard limit of ~3 entries (however many were added during the initial auto-refresh window).Changes
Bug fix
_analyticsHtmlCache/_analyticsCacheUrlinaddSubEntryandremoveSubEntrybefore callingrender()UX: any service, any plan
<select>dropdowns (constrained to 5 predefined services) with<input>+<datalist>— users can type any service name (GitHub Copilot, Windsurf, JetBrains AI, etc.)oninputwith case-insensitive matchSecurity
e.fromwas interpolated intoinnerHTMLwithoutescHtml()— all other fields were escaped, this one was missedUI polish
color-scheme: darkto:rootso native datalist popup and date picker match the dark themearia-labelto all form inputsTest plan
localStorage['codedash-subscription']with a craftedfromfield containing<img src=x onerror=alert(1)>— verify it renders as escaped text, not executed