Skip to content

fix: unique process keys per instance to prevent collision on multi-monitor setups#7

Open
navidagz wants to merge 1 commit into
rahulmysore23:mainfrom
navidagz:fix/proc-key-collision-multi-instance
Open

fix: unique process keys per instance to prevent collision on multi-monitor setups#7
navidagz wants to merge 1 commit into
rahulmysore23:mainfrom
navidagz:fix/proc-key-collision-multi-instance

Conversation

@navidagz

@navidagz navidagz commented Jul 5, 2026

Copy link
Copy Markdown

Description

Problem

When running two instances of the plugin (one per monitor) and calling dms ipc call plugins reload pkgUpdate,
one instance would get stuck showing "Checking for updates" indefinitely.

The cause: Proc.runCommand uses a string key to identify and deduplicate managed processes globally across the
shell. All three keys (pkgUpdate.dnf, pkgUpdate.flatpakMeta, pkgUpdate.flatpakUpdates) were hardcoded, so when
the second instance called checkUpdates(), DMS saw those keys already in use by the first instance and skipped
spawning new processes. The callbacks never fired, leaving dnfChecking and flatpakChecking stuck at true.

Fix

Added a _procNs property that generates a random per-instance prefix at construction time using
Math.random().toString(36).slice(2). All Proc.runCommand keys are now namespaced under this prefix, making them
unique per instance regardless of how many bars are running.

Verification

Confirmed two instances produce distinct keys on reload:

procNs = pkgUpdate.f2yggwctnyinj025t5qj8a.dnf
procNs = pkgUpdate.43suodu04i5f08dplmb5oe.dnf

@navidagz

navidagz commented Jul 5, 2026

Copy link
Copy Markdown
Author

@rahulmysore23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant