Skip to content

Fix corrupted file answer and improve logs#492

Open
rob93c wants to merge 4 commits intomainfrom
fix-corrupted-file-answer
Open

Fix corrupted file answer and improve logs#492
rob93c wants to merge 4 commits intomainfrom
fix-corrupted-file-answer

Conversation

@rob93c
Copy link
Copy Markdown
Member

@rob93c rob93c commented Apr 18, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved error messaging when media conversion fails due to detected corruption, now references "the media" instead of "the video" for better clarity.
  • Chores

    • Refactored internal error handling and structured logging infrastructure to improve diagnostics, context tracking, and maintainability throughout the application.

@rob93c rob93c requested a review from MartelliEnrico April 18, 2026 10:05
@rob93c rob93c self-assigned this Apr 18, 2026
@rob93c rob93c added enhancement New feature or request logs This marks changes revolving around logs labels Apr 18, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ddc0af54-0970-4090-8b48-1439d5333ba1

📥 Commits

Reviewing files that changed from the base of the PR and between e118d68 and 19d0c1f.

📒 Files selected for processing (4)
  • src/main/java/com/github/stickerifier/stickerify/bot/Stickerify.java
  • src/main/java/com/github/stickerifier/stickerify/logger/StructuredLogger.java
  • src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java
  • src/main/java/com/github/stickerifier/stickerify/telegram/Answer.java

📝 Walkthrough

Walkthrough

Refactored structured logging infrastructure by renaming ScopedValue keys (REQUEST_DETAILS → REQUEST_DETAILS_VALUE, MIME_TYPE → MIME_TYPE_VALUE) and introducing new log-key string constants. Updated all call sites to use the new naming convention. Minor text update in error messages.

Changes

Cohort / File(s) Summary
Logging Constants & Context Setup
src/main/java/com/github/stickerifier/stickerify/logger/StructuredLogger.java
Renamed exported ScopedValue keys and added new constants (FILE_ID_VALUE, REQUEST_DETAILS_VALUE, MIME_TYPE_VALUE). Introduced new log-key string constants: EXCEPTION_MESSAGE_LOG_KEY, ORIGINAL_REQUEST_LOG_KEY, FILE_PATH_LOG_KEY, STICKER_LOG_KEY. Updated at(Level) method to conditionally enrich logging with context entries using new constants.
Logging Usage Updates
src/main/java/com/github/stickerifier/stickerify/bot/Stickerify.java, src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java
Updated all structured logging calls to use renamed ScopedValue keys and new log-key string constants. Stickerify now uses REQUEST_DETAILS_VALUE, FILE_ID_VALUE, and new exception/request/file-path logging keys. MediaHelper updated to use MIME_TYPE_VALUE, FILE_PATH_LOG_KEY, and STICKER_LOG_KEY.
Error Message Copy
src/main/java/com/github/stickerifier/stickerify/telegram/Answer.java
Updated CORRUPTED enum reply text to use generalised "media" instead of "video" when reporting conversion failures due to potential corruption.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related PRs

Suggested Reviewers

  • MartelliEnrico

Poem

🐰 Constants renamed with careful care,
Scoped values shuffle, log keys everywhere,
From "video" now we say "media" so bright,
Structured logging shines—all spellings right!
Hoppy hops through refactored night! 🌙

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the two main aspects of the changeset: updating the corrupted file answer message and refactoring logging to use structured constants throughout the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request logs This marks changes revolving around logs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant