Skip to content

bug(theme): do not drop structural refresh while theme watcher in flight #467

Description

@ZhuchkaTriplesix

Parent

Part of #463

Severity

Medium

Problem

When a debounced refresh fires while _refreshInFlight is true, _triggerRefresh returns immediately after _pendingStructural was already cleared. That refresh is lost with no reschedule. If the skipped refresh carried structuralChange: true, loadAvailableThemes(reloadExtensions: false) may run next and leave LocalExtensionRegistry stale until another install/uninstall.

Evidence

  • lib/core/theme/theme_folder_watcher.dart (~91–107)
  • Bugbot review dev vs main (2026-07-27)

Acceptance

  • Refresh requested during in-flight run is queued and executed after
  • Structural flag is OR’d across coalesced events (not lost)
  • No infinite refresh loop

Suggested fix

Keep _pendingRefresh / _pendingStructural |= structural; when in-flight ends, if pending, schedule another _triggerRefresh.

Metadata

Metadata

Labels

bugSomething isn't workingfilesystemTheme parser epic label: filesystemthemeTheming, colors, VS Code themes

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions