python3-improv: fix missing claim token on Wi-Fi success#40
Merged
Conversation
Pass max_response_bytes=200 when constructing ImprovProtocol on all three board variants. The pyImprov default of 100 is below our Wi-Fi-success redirect URL (~117 B: the active-esl-onboard.active-esl.workers.dev host plus a UUID token), which trips a pyImprov chunking bug in build_rpc_response: it emits a spurious zero-length WIFI_SETTINGS packet *before* the packet that carries the URL. Improv clients that complete on the first (empty) result never see the token, surfacing in the app as "connected to Wi-Fi but did not return a claim token". Raising the threshold returns the URL in a single ~121 B packet, well within the ~185 B BLE MTU the app negotiates, so no split (and no leading empty packet) occurs. The app/CLI also tolerate the empty-then-URL sequence defensively. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
build_rpc_responsechunks the RPC response atmax_response_bytes(default 100). Our Wi-Fi-success redirect URL is ~117 B (active-esl-onboard.active-esl.workers.dev?...&token=<uuid>), so it exceeds the threshold and pyImprov emits a spurious zero-lengthWIFI_SETTINGSpacket before the packet that actually carries the URL. Clients that complete on the first (empty) result never see the token.ImprovProtocol(..., max_response_bytes=200)on all three board variants (imx93-jaguar-eink,imx8mm-jaguar-inst, default). The URL now returns in a single ~121 B packet — no split, no leading empty packet — comfortably within the ~185 B BLE MTU the app negotiates.Notes
Test plan
WIFI_SETTINGSresult arrives as a single packet (no leading empty packet) via theimprov-provisionCLI smoke test.Made with Cursor