Conversation
There was a problem hiding this comment.
Pull request overview
Fixes installed add-on VirusTotal scan results failing to load by ensuring cached scan data is serialized in the same structure as the add-on store server payload.
Changes:
- Added
VirusTotalScanResults.toDict()to serialize scan results in the server-compatiblevirusTotal -> last_analysis_statsshape. - Updated
_AddonGUIModel.asdict()to serializeVirusTotalScanResultsusingtoDict()and storevtScanUrlalongside it. - Modernized a few type hints/imports in
addon.pywhile updating the license header.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
source/addonStore/models/scanResults.py |
Adds toDict() for server-compatible serialization of VirusTotal scan results. |
source/addonStore/models/addon.py |
Updates dataclass serialization to use VirusTotalScanResults.toDict() and persist vtScanUrl. |
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
|
@seanbudd should the error have disappeared? I still have the same errors when opening the store on last beta (). Also, have you considered #19984 (comment)? If yes and if you have chosen to keep the structure as is, can you provide a reason? Storing a one million char in a json data is quite unusual (and freezing NVDA...) |
The error will remain until the relevant add-on file e,g.
Changing something like this is beyond an emergency hot-fix during the translation freeze. |
OK, so deinstalling/uninstalling the add-ons will be enough. Thanks.
OK. So it's unrelated to this issue/fix? I'll open an issue if it's really problematic in the future. I had provided a feedback on this point in case there was a broader impact than only for devs. Since it has an impact on the API, it may have had better to fix this before this goes in the final 2026.1 API version. It's worth noting that this had been introduced very late in the beta dev cycle (around beta6); that's why we end up now with something that cannot be changed anymore due to freeze (except if the freeze is extended). |
|
I don't think it's worth an email as there is no significant impact. I don't think the scan details being missing for add-ons already installed is high impact - the add-on is already installed, the risk has already been taken. The comments regarding how the main data is stored as a string is unrelated to the issue that was fixed in the beta. |
OK. In case we have too many reports or messages about these errors in the future, we can still send a message at that time if needed.
What I had in mind when writing "introduced late" was the pickle to json conversion (#19564). There is no specific usage regarding what is stored in pickle files. On the opposite, it's quite uncommon, even if not forbidden, to have 1 million char strings stored in a json field. One of the advantages of json is that they are easily readable in an editor; that's not the case for this string. From user point of view, there is no change though. So I acknowledge that it's now too late for introducing any 0-user impact modifications now. |
|
#19564 affected the enabled/disabled state of add-ons, it didn't change how we stored this add-on data from the add-on store, which was always in this JSON form. |
Oh so the issue is not new, but with no user impact, and I had never encountered it before... |
|
That's okay - it helped with investigating and I agree it would be nice to fix. It's not very readable for devs now |
Link to issue number:
Closes #19984
Summary of the issue:
Once an add-on is installed, VirusTotal scan results would be cached in a different format than what was served by the server.
This would cause issues in unpacking the scanned data.
This would cause scan results to fail to be loaded for installed add-ons.
Description of user facing changes:
Viewing scan results for installed add-ons should be fixed
Description of developer facing changes:
None
Description of development approach:
toDictmethod to theVirusTotalScanResultsclass inscanResults.py, enabling conversion of scan result objects to a dictionary format matching the original scan results structure.asdictmethod inAddonStoreModelto usetoDictforVirusTotalScanResultsfields, ensuring correct serialization.Testing strategy:
Manual testing via add-on store manual test plan
Known issues with pull request:
none
Code Review Checklist: