Skip to content

fix(tailscale): project status JSON fields before Luau decode - #439

Open
nicobonada wants to merge 1 commit into
noctalia-dev:mainfrom
nicobonada:fix/tailscale-project-status-json
Open

fix(tailscale): project status JSON fields before Luau decode#439
nicobonada wants to merge 1 commit into
noctalia-dev:mainfrom
nicobonada:fix/tailscale-project-status-json

Conversation

@nicobonada

Copy link
Copy Markdown
Contributor

Plugin

  • Id: davemhammer/tailscale
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Follow-up to #362. That PR filters unused Mullvad exits out of tailscale status --json before Luau decodes it. The leftover JSON is still fat: each remaining peer carries sshHostKeys, Self carries CapMap, and so on — fields parseStatus never reads.

On a loaded machine that leftover decode plus state.set of the snapshot can still exceed Noctalia's 25ms plugin CPU budget, which auto-disables the service (script callback 'async command callback' exceeded its CPU budget).

This keeps the existing Mullvad Peer filter as-is, then jqs the same pipe down to the fields the service actually uses (same idea as the existing debug prefs projection). state.set is skipped when the snapshot signature did not change. Version 1.0.61.0.7.

External dependencies

Unchanged: tailscale, jq, xdg-open. jq already filtered status --json after #362; it now also projects fields, still in that one pipe.

Testing

Reproduced the CPU-budget apply failed log on Niri / NixOS with Mullvad exits in the netmap (raw status --json ~870 KB / 560 peers; after #362 ~15 KB; after this projection ~3.2 KB / 7 real machines). After the change, noctalia msg plugin davemhammer/tailscale:service all refresh succeeds and the bar/panel still show real machines plus the exit-node list.

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against: 5.0.0
  • Plugin API level: 10

Screenshots / Videos

None — no UI change. Same bar/panel; smaller JSON on the existing jq pipe.

Checklist

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • I created thumbnail.webp with the thumbnail generator. (unchanged; not a new plugin)
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no unreviewed machine/LLM translations). (no locale files touched)
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

After the Mullvad Peer filter, leftover objects still carry unused
fields (sshHostKeys, CapMap, …). Keep the same filter, then pick only
the fields parseStatus reads. Skip state.set when nothing changed.
@github-actions

Copy link
Copy Markdown
Contributor

CC @davemhammer

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