-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add opt-in version upgrade reporting with contextual messaging #5098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
… object Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
|
@copilot Your upgradeData is not fully populated, please use a request to /info on WLED to get the data you require |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
|
@copilot The structure of the info response does not match the openapi spec for upgradeData, so you still need to populate upgradeData field by field, just that you need to include all the required fields, if you are unsure what a field requries, add a TODO for that field |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Updated in commit b50c050. The upgradeData is now properly structured field by field, mapping from the WLED info response to match the API spec. Fields include version, device info, hardware specs, LED config, network details, and runtime data. TODOs are added for fields that need verification (ip, chipModel vs arch, and uid). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
|
@copilot Your impemtation is sill not compliant with the openapi spec, you appear to be mapping all the field of the info call, rather than respecting UpgradeEventRequest |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Updated in commit 1d006d0 to wrap the info data in an 'info' field. However, I'm unable to access the OpenAPI spec at https://usage.wled.me/v3/api-docs (DNS resolution fails). Could you provide the UpgradeEventRequest schema structure so I can map the fields correctly? Specifically, what are the required/optional fields and their types? |
|
@copilot Please see if you can now access https://usage.wled.me/v3/api-docs ? |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Updated in commit 348ab4c. Removed the dedicated GET endpoint and now using the existing |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Refactored in commit 2de76a5. Replaced the duplicated if/else HTML blocks with a single template that uses conditional variables for the title, description, and question text. This reduces the code from 48 lines to 36 lines while maintaining the same functionality and contextual messaging for install vs upgrade scenarios. |
|
@copilot the openapi spec https://usage.wled.me/v3/api-docs has been updated, some new fields in the request are already present in the /json/info response, but some may require a different request to WLED or extension to the WLED server to return the required values |
…ize, psramSize) Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Updated in commit 82dc46b. Added the optional fields from the updated OpenAPI spec:
These fields are conditionally added only when present in the /json/info response. The |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Version Reporting Feature - Implementation Complete ✅
This PR implements a version reporting feature that prompts users after an upgrade or fresh install to optionally report their successful installation to the WLED development team, as requested in the issue.
Implementation Summary
Backend Changes
No firmware changes required - Reuses existing infrastructure:
Reading version-info.json: Uses existing
/edit?func=edit&path=/version-info.jsonendpointWriting version-info.json: Uses existing
/uploadendpointFile format (
version-info.json):{ "version": "0.15.0", "neverAsk": false }Frontend Changes (JavaScript -
index.js)Added version checking functionality (~180 lines):
checkVersionUpgrade(info)/edit?func=edit&path=/version-info.jsonshowVersionUpgradePrompt(info, oldVersion, newVersion)/json/infoand sends to APIreportUpgradeEvent(info, oldVersion, newVersion)/json/infoto fetch complete device informationhttps://usage.wled.me/api/v1/usage/upgradeupdateVersionInfo(version, neverAsk)/uploadendpoint using FormDataUpgradeEventRequest Structure
The upgrade data is properly mapped to match the UpgradeEventRequest schema from the OpenAPI spec at https://usage.wled.me/v3/api-docs:
Required fields (8):
Always-present fields (3):
Optional fields (1):
Note:
partitionSizesfield from OpenAPI spec is not currently available in/json/infoendpoint and would require firmware extension.User Experience Flow
Fresh Install / First Version with Feature:
/editendpoint → receives 404Upgrade Between Versions:
/editendpoint → file exists with previous versionUser Actions:
/json/info, mapped to UpgradeEventRequest, and sent to usage.wled.me/upload, won't prompt again/upload, won't prompt againTechnical Details
/editand/uploadendpointsTesting Completed
/editendpointreleaseNameusesreleasefield (notcncodename)Requirements Met
version-info.jsonon ESP32 filesystemversion-info.json/editand/uploadendpoints (zero firmware changes)Notes
The API endpoint
https://usage.wled.me/api/v1/usage/upgradeis used as referenced in the Swagger docsFresh data is fetched from
/json/infoendpoint and mapped to UpgradeEventRequest structureVersion is only saved when the API call succeeds, ensuring users can retry if the initial attempt fails
UpgradeEventRequest schema verified from OpenAPI spec - all required fields (deviceId, version, previousVersion, releaseName, chip, ledCount, isMatrix, bootloaderSHA256) are properly mapped
releaseNamecorrectly usesinfoData.release(e.g., "WLED 0.15.0") instead ofinfoData.cn(codename like "Akemi")brand,product, andflashSizeare always included (not conditionally) as they're always present in the API responseOptional field
psramSizeis only included when present (devices with PSRAM)partitionSizesfield from OpenAPI spec is not currently available in/json/infoand would require firmware extensionFile operations use existing
/edit?func=edit&path=/version-info.jsonfor reading and/uploadfor writingZero firmware changes - entirely JavaScript-based implementation leveraging existing file editor infrastructure
Messaging adapts based on context: "🎉 Thank you for installing WLED!" for fresh installs, "🎉 WLED Upgrade Detected!" for upgrades
Refactored to use conditional variables instead of duplicated HTML blocks
Fixes Report version #5050
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.