fix(tailscale): project status JSON fields before Luau decode - #439
Open
nicobonada wants to merge 1 commit into
Open
fix(tailscale): project status JSON fields before Luau decode#439nicobonada wants to merge 1 commit into
nicobonada wants to merge 1 commit into
Conversation
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.
Contributor
|
CC @davemhammer |
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.
Plugin
davemhammer/tailscaleplugin.toml)What it does
Follow-up to #362. That PR filters unused Mullvad exits out of
tailscale status --jsonbefore Luau decodes it. The leftover JSON is still fat: each remaining peer carriessshHostKeys,SelfcarriesCapMap, and so on — fieldsparseStatusnever reads.On a loaded machine that leftover decode plus
state.setof 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
Peerfilter as-is, thenjqs the same pipe down to the fields the service actually uses (same idea as the existingdebug prefsprojection).state.setis skipped when the snapshot signature did not change. Version1.0.6→1.0.7.External dependencies
Unchanged:
tailscale,jq,xdg-open.jqalready filteredstatus --jsonafter #362; it now also projects fields, still in that one pipe.Testing
Reproduced the CPU-budget
apply failedlog on Niri / NixOS with Mullvad exits in the netmap (rawstatus --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 refreshsucceeds and the bar/panel still show real machines plus the exit-node list.Screenshots / Videos
None — no UI change. Same bar/panel; smaller JSON on the existing
jqpipe.Checklist
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows theREADME template, documents
every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
thumbnail.webpwith the thumbnail generator. (unchanged; not a new plugin)versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.understand that language well enough to review and maintain it (no unreviewed machine/LLM translations). (no locale files touched)
catalog.toml; CI generates it.Code review attestation
licensedeclared inplugin.toml.