Release v0.4.2-alpha
Pre-release
Pre-release
·
1 commit
to main
since this release
Fixed
- Cold-start screenshot detection race — Complete rewrite of
ScreenshotContentObserverto handle MediaStore cold-start indexing delay on fresh app process:- Extended URI-based retry window from 1.5s to ~10.3s with exponential backoff (200ms → 2s × 3) so MediaStore has time to populate
DISPLAY_NAMEandRELATIVE_PATHcolumns on first launch - Added
IS_PENDINGcolumn check — skips rows that MediaStore has not finished writing, returningfalsefor retry instead of giving up - Added blank column detection — returns
falsefor retry whendisplayNameorrelativePathare empty (the root cause: old code returnedtrueand marked the URI as processed before columns were populated) - Added
performInitialScan()— scans the last 30 seconds of MediaStore immediately after observer registration to catch screenshots taken during the app startup window - Added
scanLatestScreenshots()fallback — scans the last 60 seconds of MediaStore when URI-based retries are exhausted (handles edge cases whereonChangefires before MediaStore creates the row at all) - Null/parse-error
onChangeURI now falls back to scanning recent images instead of silently dropping the event handleNewScreenshotconverted from fire-and-forget coroutine tosuspendfunction so callers wait for DB insert + notification before marking the URI as processed- Dedup set capped at 200 entries with oldest-25% eviction to prevent unbounded memory growth
- Extended URI-based retry window from 1.5s to ~10.3s with exponential backoff (200ms → 2s × 3) so MediaStore has time to populate
Changed
ScreenshotDetector.startDetector()now callsperformInitialScan()on the observer right after registration