[incoming] cleanup incoming messages periodically#387
Conversation
🤖 Pull request artifacts
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (15)
WalkthroughThis PR adds incoming log retention settings, a truncation worker, and inbox settings UI wiring. It also removes unused string resources in localized XML files and reformats a long consent string element. ChangesIncoming Log Lifetime and Truncation
Locale String Resource Cleanup
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@app/src/main/java/me/capcom/smsgateway/modules/incoming/IncomingMessagesSettings.kt`:
- Around line 24-30: The lifetimeDays assignment uses toFloat().toInt() which
silently truncates decimal values like "1.9" to "1" instead of rejecting them.
Replace the toFloat().toInt() conversion chain in the lifetimeDays assignment
with a direct toInt() call, or add explicit validation to ensure the input is a
whole number before parsing. This will cause non-integer values to throw an
exception rather than being silently coerced.
In
`@app/src/main/java/me/capcom/smsgateway/modules/incoming/workers/IncomingLogTruncateWorker.kt`:
- Around line 24-27: In the `doWork()` method of `IncomingLogTruncateWorker`,
change the catch clause from catching `Throwable` to catching `Exception`
instead. Additionally, add a check within the catch block to detect if the
caught exception is a `CancellationException`, and if so, rethrow it immediately
to allow coroutine cancellation to propagate properly. This ensures that when
the worker is cancelled, the cancellation signal is not mistakenly converted to
a retriable failure, which would break the cancellation semantics of
`CoroutineWorker`.
In
`@app/src/main/java/me/capcom/smsgateway/ui/settings/IncomingSettingsFragment.kt`:
- Around line 16-18: The preference key being checked in the when statement does
not match the actual key defined in the XML preferences file. In the when block
that handles the preference customization, change the key from
"incoming.log_lifetime_days" to "incoming.lifetime_days" to align with the key
defined in incoming_preferences.xml. This mismatch is preventing the
setOnBindEditTextListener block from executing when the preference is accessed.
In `@app/src/main/res/values/strings.xml`:
- Line 179: The incoming_dotdotdot string resource uses three ASCII dots ("...")
instead of the single ellipsis character ("…") that other *_dotdotdot labels use
throughout the strings.xml file. Replace the three ASCII dots in the
incoming_dotdotdot string with the single Unicode ellipsis character to maintain
consistency with the existing UI label formatting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8f3e21f-80ff-45d0-8707-c73228f416cd
📒 Files selected for processing (12)
app/src/main/java/me/capcom/smsgateway/modules/incoming/IncomingMessagesService.ktapp/src/main/java/me/capcom/smsgateway/modules/incoming/IncomingMessagesSettings.ktapp/src/main/java/me/capcom/smsgateway/modules/incoming/db/IncomingMessagesDao.ktapp/src/main/java/me/capcom/smsgateway/modules/incoming/repositories/IncomingMessagesRepository.ktapp/src/main/java/me/capcom/smsgateway/modules/incoming/workers/IncomingLogTruncateWorker.ktapp/src/main/java/me/capcom/smsgateway/modules/orchestrator/OrchestratorService.ktapp/src/main/java/me/capcom/smsgateway/modules/settings/Module.ktapp/src/main/java/me/capcom/smsgateway/modules/settings/SettingsService.ktapp/src/main/java/me/capcom/smsgateway/ui/settings/IncomingSettingsFragment.ktapp/src/main/res/values/strings.xmlapp/src/main/res/xml/incoming_preferences.xmlapp/src/main/res/xml/root_preferences.xml
cdf8b36 to
d5d85b6
Compare
d5d85b6 to
4abf62f
Compare
4abf62f to
34cecd1
Compare
34cecd1 to
1de992a
Compare
f7cef1b to
7819ca8
Compare
7819ca8 to
c0995d7
Compare
Summary by CodeRabbit