Skip to content

Cache RPC list#13

Merged
events555 merged 34 commits intotwinleaf:mainfrom
rasen68:main
Mar 23, 2026
Merged

Cache RPC list#13
events555 merged 34 commits intotwinleaf:mainfrom
rasen68:main

Conversation

@rasen68
Copy link
Copy Markdown
Contributor

@rasen68 rasen68 commented Feb 20, 2026

Changes

  • Implement functions in RpcClient (device/rpc.rs) for storing RPC lists to cache files in OS-appropriate cache directory based on rpc.hash, or reading from cache instead of requesting list from board if a cache exists
  • Update tio-tool rpc-list to use cache function
  • Update tio-monitor to use cache rpc list to enable tab completion and RPC search
  • Process hash broadcasts from board to invalidate stored rpc list in tio-monitor
  • Fix bug where session metadata was incorrectly invalidated by Device/DeviceTree

rasen68 and others added 27 commits February 6, 2026 16:36
… remove file on bad write since we remove on bad read
@rasen68 rasen68 force-pushed the main branch 2 times, most recently from ceb38db to dfd7d3f Compare March 10, 2026 12:35
@events555
Copy link
Copy Markdown
Contributor

Hi, thanks for the changes. I'll merge it to main but will also push a branch with changes (both from a rebasedmeta-fix branch and from cleaning up small things) on top of the PR.

For now I plan on reverting the restructuring the CLI for the shell completion. I got concerned over the way it was organized (particularly from the include!() chain) and will think about what existing CLIs do. Another thing was other programs seem to explicitly handle individual shell environments (zsh, bash, powershell), which these changes didn't.

Some other things to note:

  • I changed the SettingsPayload to a typed enum so we don't have to try_into().unwrap() on raw bytes
  • I ended up deciding to split the device/rpc.rs into a submodule so it wasn't a giant file
  • Renamed RpcDataKindRpcValueType and RpcMetaRpcDescriptor
  • Made tio-monitor use RpcRegistry (which has a From<&RpcList> for RpcRegistry now) instead of filtering from an RpcList
  • Merged the separate cache and RPC worker threads into a single thread with one RpcClient
  • Esc no longer quits in tio-health, matching tio-monitor behavior
  • Added RpcRegistry::search() to move some of your filtering code from tio-monitor into the library

I fixed, mainly in tio-monitor

  • completion search now uses only the method name, so suggestions still show when typing arguments
  • entering command mode no longer starts at the oldest history entry

The cache system and TUI completion seems to work well, thanks again for the good work!

@events555 events555 merged commit 605347f into twinleaf:main Mar 23, 2026
events555 added a commit that referenced this pull request Mar 23, 2026
Cleanup of PR #13 and independent fixes across parser, tio-health, and tio-tool.
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.

2 participants