mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 08:55:58 +03:00
[PR #336] [MERGED] Fail fast on invalid asset enums and add caller-side telemetry #638
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#638
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/336
Author: @AJaySi
Created: 2/10/2026
Status: ✅ Merged
Merged: 2/11/2026
Merged by: @AJaySi
Base:
main← Head:codex/refactor-save_asset_to_library-error-handling📝 Commits (1)
cffee51Fail asset tracking on invalid enums and add caller telemetry handling📊 Changes
13 files changed (+151 additions, -26 deletions)
View changed files
📝
backend/api/podcast/handlers/audio.py(+12 -2)📝
backend/api/podcast/handlers/avatar.py(+18 -3)📝
backend/api/podcast/handlers/images.py(+6 -1)📝
backend/api/story_writer/routes/media_generation.py(+12 -2)📝
backend/api/story_writer/routes/scene_animation.py(+12 -2)📝
backend/api/youtube/handlers/audio.py(+6 -1)📝
backend/api/youtube/handlers/avatar.py(+18 -3)📝
backend/api/youtube/handlers/images.py(+6 -1)📝
backend/routers/video_studio/tasks/avatar_generation.py(+6 -1)📝
backend/routers/video_studio/tasks/video_generation.py(+6 -1)📝
backend/services/image_studio/transform_service.py(+12 -2)📝
backend/services/video_studio/video_studio_service.py(+6 -1)📝
backend/utils/asset_tracker.py(+31 -6)📄 Description
Motivation
asset_type/source_modulein asset tracking and make failures explicit so telemetry can detect and alert on bad inputs.Description
save_asset_to_libraryinbackend/utils/asset_tracker.pyto fail fast on invalid enum values by logging a structured error and returningNoneinstead of coercing defaults, implemented via a helper_log_invalid_enum_valuethat emitsevent,field,invalid_value,user_id, andasset_filenamepayload.asset_id = save_asset_to_library(...)and emitting a non-blocking warning (asset_id is None) with contextualuser_id/filenametelemetry.backend/test/test_asset_tracker.pythat mockContentAssetServiceto validate: valid enum values create a row and return an ID, and invalid enum values returnNoneand produce structured error logs.asset_filename) to avoid collisions withLogRecordinternal fields when passingextratologger.Testing
backend/test/test_asset_tracker.pycovering valid and invalid enum paths;pytest -q backend/test/test_asset_tracker.pypassed (tests passed).python -m py_compilefor the modified files; compilation succeeded for the changed files.Noneand continue) via the updated test and local lint/compile checks.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.