You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tokens that refer to each other can grow without limit and freeze StableBar while loading #675
@token. and @setting. references are expanded with no limit on how much they produce. StableBar catches a reference that points back at itself, but not one that grows: when each token refers to the next one twice, the expanded value doubles at every level. A configuration, theme or package of a few lines can then produce millions of values, and StableBar freezes while it loads.
Steps to reproduce
In a scratch configuration, add tokens where each level refers to the one below twice:
"tokens": {
"t0": "#ffffff",
"t1": ["@token.t0", "@token.t0"],
"t2": ["@token.t1", "@token.t1"],
"…": "and so on up to t40",
"t40": ["@token.t39", "@token.t39"]
}
Use @token.t40 anywhere, and load the file (StableBar --validate <file>, or open it with --config).
Expected
Loading stops with a clear error that names the reference being expanded, the same way an unknown reference or a cycle does. Ordinary themes, packages and configurations load exactly as before.
Environment
main at 8196fd9 (v0.16.0-beta.20261115111438.1100).
Diagnosis
substituteConfigurationReferences in Sources/StableBar/ThemeConfiguration.swift recurses through objects and arrays and replaces each reference with its fully expanded value. It tracks the path to detect cycles, but nothing counts what it produces.
Proposal
Count the values produced while expanding references, and fail loading once the count passes 100,000, far above any real theme or configuration.
Report it through the existing configuration errors, with the reference name.
Tests: the doubling chain above fails quickly with that error; the bundled themes and examples still load.
This matters more for anything that loads a theme without a click, such as a link that previews a theme (#676): opening it must never freeze StableBar.
Related
Cycles are already caught (referenceCycle); this adds a size limit next to it.
Activity
stablebar-releases commentedon Nov 16, 2026
🎉 This issue has been resolved in version 0.16.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀