Skip to content

Fix CI lint failures: observable locale and coroutine side effects in composables#447

Merged
hossain-khan merged 2 commits into
mainfrom
copilot/fix-ci-build-issues
Apr 25, 2026
Merged

Fix CI lint failures: observable locale and coroutine side effects in composables#447
hossain-khan merged 2 commits into
mainfrom
copilot/fix-ci-build-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

CI was failing due to 5 lint errors across 3 files — two Compose API misuse categories: non-observable locale reads and coroutine creation during composition.

Changes

NonObservableLocaleAlertCheckLogViewerScreen.kt & FilterLogsUi.kt

Locale.getDefault() is not observable in composition and won't trigger recomposition on locale changes. Replaced with LocalConfiguration.current.locales[0] extracted at the top of each composable:

// Before
SimpleDateFormat("MMM dd", Locale.getDefault()).format(Date(dateRange.first!!))

// After
val locale = LocalConfiguration.current.locales[0]
SimpleDateFormat("MMM dd", locale).format(Date(dateRange.first!!))

CoroutineCreationDuringCompositionDeveloperPortalScreen.kt

scope.launch was called directly in the composition body to show a snackbar. Replaced with LaunchedEffect keyed on simulationResult:

// Before
state.simulationResult?.let { result ->
    scope.launch { snackbarHostState.showSnackbar(result) }
}

// After
LaunchedEffect(state.simulationResult) {
    state.simulationResult?.let { snackbarHostState.showSnackbar(it) }
}

Copilot AI linked an issue Apr 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix CI build issues Fix CI lint failures: observable locale and coroutine side effects in composables Apr 25, 2026
Copilot AI requested a review from hossain-khan April 25, 2026 19:02
@hossain-khan hossain-khan marked this pull request as ready for review April 25, 2026 19:29
@github-actions
Copy link
Copy Markdown

Code Coverage Report

View Coverage Report

@hossain-khan hossain-khan merged commit f464ff0 into main Apr 25, 2026
3 of 4 checks passed
@hossain-khan hossain-khan deleted the copilot/fix-ci-build-issues branch April 25, 2026 19:32
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.16%. Comparing base (185143c) to head (cb1a49f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #447   +/-   ##
=======================================
  Coverage   36.16%   36.16%           
=======================================
  Files          86       86           
  Lines        2527     2527           
  Branches      215      215           
=======================================
  Hits          914      914           
  Misses       1574     1574           
  Partials       39       39           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown

📊 APK Size Analysis

Comparing maincopilot/fix-ci-build-issues (this PR)

⚠️ Diffuse analysis failed. Check the workflow logs for details.


Generated by Diffuse via diffuse-action

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.

Fix CI build issues

3 participants