Fix ANR & CRASH - #54
Merged
Merged
Conversation
…istence - Remove `applicationIdSuffix` from the mock product flavor and update `google-services.json` to match the base package name to avoid Firebase API key restrictions. - Update `FakeFirebaseClientAuth` to persist and restore the mock user's email using `SharedPreferences`. - Refactor `RepositoryModule` to provide `@ApplicationContext` to `providePreferenceRepository` and `provideAuthClient`. - Migrate `providePreferenceRepository` from using `FakePreferencesHelper` to `AppPreferencesWrapper` with real `SharedPreferences`. - Update `FakeFirebaseUserApiHelper` to lazily initialize and cache fake user data if it doesn't exist. - Update `FakeFirebaseStoreApiHelper` to automatically populate the store list with fake data if empty.
- Create `app/src/mock/AndroidManifest.xml` to configure build-variant specific meta-data. - Deactivate Firebase Performance Monitoring and Crashlytics data collection to prevent background thread crashes caused by invalid credentials in the mock flavor.
- Remove `google_maps_api_key` and `google_maps_browser_key` from `app/src/mock/res/values/secret.xml`. - Rely on inheritance from the main source set's `secret.xml` for these keys to avoid duplication.
…n persistence - Update `LoginViewModel` to prioritize existing user profiles from the repository and ensure basic user data is populated before updating. - Enhance `FakeFirebaseUserApiHelper` to persist and restore mock user data (email and name) using `SharedPreferences`. - Modify `FakeFirebaseClientAuth` to store and retrieve the mock user's name, improving data consistency across app restarts. - Update `RepositoryModule` to provide `Context` to `FakeFirebaseUserApiHelper` for shared preferences access. - Adjust mock sign-in logic to provide an empty name, allowing `LoginViewModel` to derive display names from emails.
- Set `checkReleaseBuilds = false` in the `lint` configuration to prevent build failures. - Add documentation noting that `lintVitalAnalyzeProdRelease` crashes due to a known bug in the Kotlin Analysis API when processing `.kts` files.
… thread - Wrap `WorkManager.enqueueUniquePeriodicWork` within a `CoroutineScope` using `Dispatchers.IO` to avoid blocking the main thread during initialization.
- Migrate map fragment initialization from `onActivityCreated` (deprecated) to `onViewCreated`. - Optimize marker rendering by adding a visibility check to only add markers within the current map bounds. - Refactor `inflateSupportMapFragment` to use `commitAllowingStateLoss()` and simplify the fragment retrieval logic. - Update `inflateSupportMapFragment` return type to nullable `SupportMapFragment?` and remove unnecessary `executePendingTransactions()`.
…oviderClient` - Replace deprecated `GoogleApiClient` and `FusedLocationApi` with `FusedLocationProviderClient` to prevent potential ANRs caused by blocking main thread calls. - Update location updates to use `LocationCallback` instead of the legacy `LocationListener`. - Implement `fetchLastLocationAsync` using a Task-based callback to retrieve the last known location without blocking. - Update `LocationRequest` creation to use the modern `LocationRequest.Builder` with `Priority.PRIORITY_HIGH_ACCURACY`. - Simplify provider initialization and termination logic by removing connection callbacks and manual disconnection steps.
nhoxbypass
force-pushed
the
bug/fix_anr_crash
branch
from
April 16, 2026 18:20
1b34be1 to
9fd389a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #54 +/- ##
==========================================
Coverage 17.30% 17.31%
Complexity 196 196
==========================================
Files 97 97
Lines 2537 2536 -1
Branches 223 223
==========================================
Hits 439 439
+ Misses 2081 2080 -1
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.