feat(logger): [SDK-4939] wire Android FileLogStore for shared KMP legacy purge - #2691
Conversation
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)28/119 touched executable lines covered (23.5% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
❌ Coverage Check FailedAggregate coverage on touched lines is 23.5% (minimum 80%). |
|
Submodule re-pinned to KMP |
06297f7 to
8138ef3
Compare
|
A few items to address before merging:
The core purge classification and age-gating otherwise look good. |
|
Addressed in the latest push:
|
8138ef3 to
e554031
Compare
fadi-george
left a comment
There was a problem hiding this comment.
fix failing build/coverage checks too?
…purge Pins OneSignal-KMP-SDK to v0.1.1 and implements age-gated ILogFileStore.deleteUnrecognizedEntries on Android. Adds bounded before/after crash-dir inventory logs; purge orchestration stays in KMP. Crash-path save() uses raw Logcat so listener failures cannot flip a successful write to false. Co-authored-by: Cursor <cursoragent@cursor.com>
…h-dir helpers Extract ownership/inventory helpers to pure JVM code so Jacoco attributes them, and document that LogCrashUploader.start() completes upload+purge before the after-cleanup inventory snapshot. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Rebased onto latest
|
…n flakes The suite default EXTERNAL_CALLBACKS_TIMEOUT (10ms) can elapse before Dispatchers.IO runs preventDefault(true), so display is attempted against an unstubbed mock on slow CI runners. Co-authored-by: Cursor <cursoragent@cursor.com>
Embedding toJson(labels) in a double-quoted shell assignment breaks when a label contains spaces (e.g. Skip Coverage Check), so the bypass step aborts before coverage runs. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Linear: SDK-4939
The KMP
loggermodule and the legacyotelmodule share one on-disk crash directory ({cacheDir}/onesignal/otel/crashes). Ownership is distinguished by suffix — logger writes*.otlp; legacy otel writes bare-millis filenames plus stray.tmps.Purge orchestration lives in shared KMP (OneSignal-KMP-SDK#8 —
LogCrashUploader→ILogFileStore.deleteUnrecognizedEntries(minAgeMillis)). This PR provides the Android store implementation and rollout inventory logs.Changes
OneSignal-KMP-SDKto KMP DatabaseNotClosedException raised when notification arrives #8 (post-upload /finallypurge, age-gated foreign deletes, cancellation-safe).FileLogStore.deleteUnrecognizedEntries(minAgeMillis)— Android implementation; deletes non-.otlpentries at leastminAgeMillisold; preserves owned.otlpand too-young foreign files.OneSignalCrashUploaderWrapper— before/after crash-dir inventory when the logger module is active (no host-side purge call).FileLogStoreTest— stale purge / young preserved / keep-owned / missing-dir / idempotency.Merge order
Test plan
:OneSignal:core:compileDebugKotlin(after submodule pin):kmp:testDebugUnitTest --tests "*LogCrashTest*":OneSignal:core:testDebugUnitTest --tests "*FileLogStoreTest*"SDK_CUSTOM_LOGGINGon, seed a stale legacy file in the crash dir, confirm KMP purge removes it and after-cleanup inventory logslegacy=0Made with Cursor