Repository navigation
Conversation
…laceOS apps Adds the RemoteDebug logic driver for the remote debugging interface in PlaceOS/user-interfaces#753. People with the support role request logs and send commands by device ID. Devices send entries with `post_logs` and results with `command_result`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- add `register` so fixed devices show in `devices` - remove `media:<id>`; captures stay in `results:<id>` - remove devices that do not call for 7 days, with their data - write `last_seen`-only changes to `devices` each minute - return nil from `send_command` when the device has 20 commands - remove the StaffAPI upload removal, which trusted the upload ID from the device Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- keep 8,000 entries per device, so `before` gets all device entries - keep the first user that calls for each device ID, and ignore device calls for that ID from other users - remove each entry and result 7 days after the driver gets it - give each expiry timer a token, so an old timer cannot end a newer request - check the request and owner again after writes that let other calls run - ignore late batches from an app session before a reload - limit device text fields, settings keys and navigate paths - cancel command timeouts when the result arrives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
PlaceOS/user-interfaces#753 lets apps such as Booking Panel, Control and Signage send their logs, status and screen captures to a
RemoteDebugdriver, but that driver did not exist. This PR adds it.It has the same methods and bindings as the mock in
libs/mocks/src/lib/realtime/remote-debug.ts. It also follows the "Driver requirements" indocs/remote-debug.mdof that PR.request_logs,set_level,stop_logsandsend_command. These need the support role.post_logs,command_resultandregister. Fixed devices, such as panels and signage, callregistereach 15 minutes so the admin views list them.device:<id>,devices,logs:<id>andresults:<id>. Screen captures are results, with the upload ID inresult.data.upload_id.beforecan get them all), 50 results per device, 1,000 devices and 20 commands per device.send_commandreturnsnullwhen the list is full. Commands time out after 15 minutes. A log request stops when its duration ends.Differences from the mock
null, which the admin panel shows as "list full".device:<id>binding with no request and no commands is set tonull, so PlaceOS removes the key.post_logsandcommand_resultare ignored whendevice.idis not thedevice_idargument.post_logsalso ignores a late batch from an app session before a reload.devicesupdates at once when a device is added, changed or removed. When onlylast_seenchanges, it updates once each minute. Without this, eachpost_logsandregistercall would send the full device list again.[A-Za-z0-9_-]{1,64}, 500 characters for each device text field, 100 entries for each call, 2,000 characters for each message, 100,000 characters for each result, 50 settings keys of 200 characters, and navigate paths of 2,000 characters.Known limits
devices,logs:<id>andresults:<id>.Not in this PR
remote-debug-<device>-<command>. That also gets uploads from commands that timed out, and does not trust an upload ID from a device.post_logscall sendslogs:<id>again with up to 8,000 entries, about 2.3 MB. Three devices that send each second write about 20 MB/s. The mock works the same way. A log request lasts 1 hour maximum.placeos-drivercan log only the key for large values.Tests
./harness report drivers/place/remote_debug.cr: 7 examples pass. They cover the same cases as the mock tests, plus the result size limit,register, the full command list, device ID owners, older entries withbefore, and late batches from an earlier session. The 7-day limit and the 15-minute command timeout have no test, as the driver has no test clock.Council review
Rounds: 4 with gpt-6.2-sol on high. Verdict: approved. Two disputed items were left for the author: a test of the 7-day limit, and a retry of status writes that fail after the Redis reconnect (see Known limits).
Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code