fix(validation): populate screenshot_paths column + backfill from raw_response
Two bugs preventing screenshot display in report UI: 1. Plugin's ValidationRecord constructor did NOT include screenshot_paths (plural, JSON array). The column stayed NULL even though paths were stored in raw_response. Records created by the plugin now include screenshot_paths=webp_paths|jpeg_paths. 2. Backward compat for existing records: _record_to_dict now falls back to extracting screenshot_paths from raw_response JSON when the DB column is empty. Also fixes: broken import statement in validation_service.py (missing closing paren + missing imports from earlier edit).
This commit is contained in:
@@ -478,6 +478,7 @@ class DashboardValidationPlugin(PluginBase):
|
||||
summary=validation_result.summary,
|
||||
issues=[issue.model_dump() for issue in validation_result.issues],
|
||||
screenshot_path=validation_result.screenshot_path,
|
||||
screenshot_paths=webp_paths or jpeg_paths,
|
||||
raw_response=json.dumps(result_payload, ensure_ascii=False),
|
||||
)
|
||||
db.add(db_record)
|
||||
|
||||
Reference in New Issue
Block a user