Skip to content

fix(crash-log): trimOldLogs wiped all logs instead of keeping the newest#7

Merged
kxxoling merged 3 commits into
devfrom
bugfix/runtime-fixes
Jun 20, 2026
Merged

fix(crash-log): trimOldLogs wiped all logs instead of keeping the newest#7
kxxoling merged 3 commits into
devfrom
bugfix/runtime-fixes

Conversation

@kxxoling

Copy link
Copy Markdown
Owner

No description provided.

kxxoling added 3 commits June 20, 2026 20:44
trimOldLogs captured files.size once outside the loop and never updated the
condition, so once >=10 logs existed every new crash erased ALL of them rather
than keeping the newest 9. Extract logsToTrim() (now unit-tested) and delete
only the oldest surplus files.
- SettingsActivity used remember { CoroutineScope(Dispatchers.Main) } whose
  coroutines outlived the Activity; switch to rememberCoroutineScope()
  (cancelled on leaving composition).
- Local import used fixed names local_import.zip / local_import_dir in the
  cache dir; concurrent/double imports overwrote each other. Use
  File.createTempFile and a UUID-suffixed temp dir.
- lerp now clamps t to [0,1] defensively (its callers currently only pass 0/1
  but the smoothing path could overshoot by epsilon).
- selectRandomLayout used biased System.nanoTime() % size; switch to
  Random.nextInt.
@kxxoling kxxoling merged commit c6fe31d into dev Jun 20, 2026
1 check passed
@kxxoling kxxoling deleted the bugfix/runtime-fixes branch June 20, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant