Add RPC tester interface to example app - #1085
Conversation
This can be used to exercise sending / receiving rpc requests in the example app
| children: [ | ||
| Expanded( | ||
| child: Text( | ||
| entry.topic, | ||
| style: theme.textTheme.titleSmall?.copyWith(fontWeight: FontWeight.bold, color: theme.scaffoldBackgroundColor), | ||
| ), | ||
| ), |
There was a problem hiding this comment.
A drive by comment: the colors in this app (besides being out of date) are fairly limited, which makes styling some of these more complicated interfaces fairly challenging.
I think I might make a follow up pull request which updates the example to use the more modern color pallete / logo, and at the same time try to add in some more color scales to make this less annoying.
The RPC tester itself landed on main through #1087, which included a hardened copy of this branch's rpc_test_sheet.dart and the controls.dart wiring. Resolve the add/add conflict by taking main's version, so this branch now carries only follow-up fixes.
Register the method with the room before tracking it, so a method already registered by another component does not leave a phantom card whose unregister button would remove a handler the tester does not own. Cap the per handler invocation log at 200 entries and stop notifying listeners from in flight handlers after disposal.
…ts leave The form field only reads initialValue when its state is created, so a stale selection could outlive its participant and trip the framework assert that the value must be among the items. Key the field by the participant list and validate the selection before sending.
|
Updated this branch to bring it back to life. The tester itself already landed on main through #1087, which included a hardened copy of this file, so the merge resolves to main's version and keeps the original commits in history. On top of that this PR now carries follow-up fixes to the tester: registration is ordered so a method owned by another component can't leave a phantom card, the per handler invocation log is capped, in flight handlers no longer notify after disposal, and the destination dropdown stays valid when the selected participant leaves. |
This comment has been minimized.
This comment has been minimized.
hiroshihorie
left a comment
There was a problem hiding this comment.
Reviewed the follow-up fixes, all good. The original tester landed via #1087.
Adds a new button on the bottom control bar for the "rpc tester":
When clicked, it opens up a new panel which has two sections:
The top section allows sending RPC messages - select a destination participant, topic, and enter a payload, and click "Send". Note that there are two payload presets -
"hello world"and"X" * 20000to provide some easy to generate data to test some edge cases.The bottom section lets you configure rpc handlers. Enter a rpc handler topic and a static response, and submit. Then when this participant receives a RPC request, the request will be responded to with the static response. This static response also has the same payload presets as the request.
Warning
This pull request was LLM generated and has only been lightly reviewed by a human. The author has tested this and confirms it works in the happy path, but no other validation has been done.
A more thorough review of this needs to occur before it could be merged.