
| Audited | android/architecture-samples at commit ee66e1526b84c026615df032c705842b7d2a521f |
|---|---|
| Date | 11 October 2026 (audited again; first audit 11 October 2026) |
| How it ran | local run on our workstation, full audit, Standard review |
| Verdict after review | Fail (Fail if a High finding remains after review, otherwise Pass with notes) |
Compared with the first audit
Same commit as the first audit: the project's default branch has no later commits (checked 11 October 2026), so nothing could have been fixed upstream in between. Each finding of the first audit (11 October 2026) was checked again against the code audited now. 29 findings in the first audit; 29 still open (20 found again, 9 not reported again but still present). This audit has 29 findings after review, 9 of them new.
| First audit | Finding | Reviewed rating then | Now | In this audit |
|---|---|---|---|---|
| #1 | Release shrinker keeps all app code | Low | Still open | #1 |
| #2 | Idling-resource helper/dep in prod | Low | Still open | #4 |
| #3 | Jetifier still enabled | Info | Still open | #5 |
| #4 | Statistics error shown as "no tasks" | Low | Still open | #2 |
| #5 | Background sync failures swallowed | Low | Still open | #3 |
| #6 | Cursor invisible | Low | Still open | #24 |
| #7 | Drawer header hard-coded colour | Info | Still open | #7 |
| #8 | Leftover colour/drawable resources | Low | Still open | not reported again |
| #9 | Previews use default MaterialTheme | Info | Still open | not reported again |
| #10 | Detail back arrow not mirrored in RTL | Low | Still open | #20 |
| #11 | LazyColumn items without key | Low | Still open | #8 |
| #12 | Two pull-to-refresh impls, blank edit loading | Low | Still open | not reported again |
| #13 | Stale androidxCompose = "1.2.0" | Info | Still open | not reported again |
| #14 | Refresh overwrites unsynced local changes | Medium | Still open | #10, #11 |
| #15 | Network priority dropped in round trip | Info | Still open | #12 |
| #16 | Write paths repeat "write then push" | Info | Still open | #13 |
| #17 | Required-fields rule only in UI | Info | Still open | not reported again |
| #18 | Unordered background pushes | Low | Still open | #15 |
| #19 | Double-tap save creates duplicates | Low | Still open | #16 |
| #20 | Overlapping refreshes hide spinner early | Info | Still open | not reported again |
| #21 | Open decisions only in TODO comments | Info | Still open | #2 |
| #22 | User journey documented on external wiki | Info | Still open | not reported again |
| #23 | Pure filter helpers in ViewModel | Info | Still open | not reported again |
| #24 | Snackbar plumbing copied across screens | Info | Still open | #18 |
| #25 | Refresh table replace not atomic | Low | Still open | #22 |
| #26 | Edit of vanished task crashes | Low | Still open | #23 |
| #27 | observeById non-null, "not found" unreachable | Low | Still open | #26 |
| #28 | Statistics screen double padding | Low | Still open | #25 |
| #29 | Keyboard covers add/edit form and save button | Medium | Still open | not reported again |
Each finding keeps the number it has in the audit report. The rating shown first is the one after review; the first automated rating is listed with it. 15 findings were first rated Medium or High; 3 of them are Medium or High after review. Text marked "From the report" is quoted from the audit report; fixes are suggestions and were not tested. Code locations link to the file and line at the audited commit.
High after review (1)
From the report
val remoteTasks = networkDataSource.loadTasks()
localDataSource.deleteAll()
localDataSource.upsertAll(remoteTasks.toLocal())
refresh treats the remote copy as the whole truth and throws away whatever the local database holds. Production dependency injection binds TaskNetworkDataSource (di/DataModules.kt:50), an in-memory list seeded with two sample tasks that resets on every process start.
The concrete impact:
- The user creates tasks, which persist in Room.
- The app is restarted.
- The user pulls to refresh, taps "Refresh", or taps "Clear completed" (which calls refresh).
- All of their tasks are deleted and replaced by the two sample tasks. The loss is permanent.
The same overwrite also discards any local change whose upload failed (finding 3) or has not landed yet.
- Never replace local rows that hold unsynced changes: keep a per-task pending or dirty flag, or push pending changes first.
- Merge by id instead of delete-and-replace.
- Bind a persistent backend in release builds, and keep the in-memory source for debug and test.
Review: DataModules.kt:50 binds the in-memory TaskNetworkDataSource, seeded with PISA and TACOMA. Room is persistent. refresh() at 159-161 does deleteAll() then upsertAll(remote), triggered by pull-to-refresh, the Refresh menu item and Clear completed. After a restart all user tasks are gone for good. The earlier verify graded the nearest row MEDIUM without the restart scenario. The only mitigation is that the backend is a documented stub.
Medium after review (2)
app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksViewModel.kt:110From the report
taskRepository.clearCompletedTasks()
showSnackbarMessage(R.string.completed_tasks_cleared)
refresh()
clearCompletedTasks() starts an upload in the background and returns at once, then refresh() races that upload for the remote source. If the refresh reads first, it loads the old remote list and writes the cleared tasks back into the local table. The user just saw the "Completed tasks cleared" message, yet the tasks reappear.
remove the refresh() call, because the Room flow already updates the list. Alternatively, have the repository finish any pending upload before a refresh.
Review: clearCompletedTasks() calls refresh() (TasksViewModel.kt:108-110) while the upload launched at DefaultTaskRepository.kt:174 is still pending. The refresh normally takes the 2000 ms-latency network mutex first and reads the old list.
.github/workflows/build_test.yaml:52From the report
script: ./gradlew :app:connectedCheck --stacktrace
the only CI job runs instrumented tests on a debug build. These never run, so failures in any of them can merge unnoticed:
- the JVM unit tests
- the formatting and lint checks
- the minified release build
add a fast job without an emulator that runs testDebugUnitTest, lintDebug, assembleRelease and the formatting check.
Review: The only test job runs :app:connectedCheck (build_test.yaml:52). The other workflow only merges branches. Spotless exists via gradle/init.gradle.kts but is never run in CI. Borderline MEDIUM.
Low after review (18)
app/proguard-rules.pro:4From the report
-keep class com.example.android.architecture.blueprints.** { *; }
...
-ignorewarnings
the release build turns on minification and resource shrinking, then cancels both:
- It keeps every class and member of the app, so nothing is shrunk or obfuscated.
- It ignores every warning, so real R8 problems pass unnoticed.
- It carries test-only directives (espresso, junit, hamcrest) into the production configuration.
- One entry names a class that does not exist:
androidx.room.RoomDataBase(line 14) should beRoomDatabase.
keep only what reflection really needs in release. Move the test directives and -ignorewarnings into proguardTest-rules.pro. Correct the Room class name. Build and smoke-test the minified release regularly.
Review: Real, but proguard-rules.pro:4 keeps only app classes, so libraries and resources are still shrunk; "nothing is shrunk" is wrong. RoomDataBase typo is at line 14.
From the report
is Async.Error -> {
// TODO: Show error message?
StatisticsUiState(isEmpty = true, isLoading = false)
when loading fails, the user is told they have no tasks, which is false and may prompt them to re-enter data. The string statistics_error already exists in strings.xml but is never used.
add an error or message field to StatisticsUiState and show statistics_error instead of the empty state.
Review: The TODO branch is at StatisticsViewModel.kt:75-76, and statistics_error is only in strings.xml:45 and used nowhere. It is reachable only if the Room flow throws.
From the report
} catch (e: Exception) {
// In a real app you'd handle the exception e.g. by exposing a `networkStatus` flow
if an upload fails, nothing is logged, nothing is retried and the user is not told. The local and remote copies drift apart without any signal. A later refresh then overwrites the local data (see finding 10). The generic catch also swallows coroutine cancellation.
- Rethrow
CancellationException. - Record the failure (a pending-sync flag or a sync-status flow) and surface "not backed up" in the UI.
- Retry with backoff, for example through WorkManager.
Review: The empty catch is at DefaultTaskRepository.kt:181-184. The scope is the application scope, so swallowing cancellation does no harm, and the KDoc at 165-172 says so.
app/build.gradle.kts:117From the report
implementation(libs.androidx.test.espresso.idling.resources)
the Espresso idling-resource library is on the release classpath. SimpleCountingIdlingResource sits in the main source set, but no production code uses it.
move the class to a debug or test source set, and change the dependency to debugImplementation or androidTestImplementation.
Review: implementation(...) at build.gradle.kts:117; SimpleCountingIdlingResource is referenced nowhere else.
app/build.gradle.kts:38From the report
javaCompileOptions {
annotationProcessorOptions {
arguments += "room.incremental" to "true"
Room and Hilt run through KSP, so this block has no effect and misleads anyone reading the build file.
delete it. Pass any Room options through ksp { arg(...) }.
Review: The javaCompileOptions block at lines 38-42 has no javac processor to act on, since Room and Hilt use ksp(...).
app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt:163From the report
LazyColumn {
items(tasks) { task ->
without keys, the list cannot keep the user's place or item state when its contents are rebuilt. A refresh rebuilds the whole table, so it can jump or lose the scroll position.
use items(tasks, key = { it.id }) and hoist a rememberLazyListState().
Review: items(tasks) has no key=. The scroll-jump claim is speculative; item identity is the real gap.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/TopAppBars.kt:170From the report
IconButton(onClick = onDelete) {
Icon(Icons.Filled.Delete, stringResource(id = R.string.menu_delete_task))
one stray tap deletes a task permanently. "Clear completed" (line 115) sits right next to "Refresh" in the overflow menu.
offer an undo snackbar or a confirmation step for both actions.
Review: IconButton(onClick = onDelete) at TopAppBars.kt:170 and the "Clear completed" item at 115, both direct.
From the report
scope.launch {
try {
val localTasks = localDataSource.getAll()
each mutation starts its own coroutine on a multi-threaded dispatcher. The coroutine reads a full snapshot of the table, then waits for the remote source. Nothing guarantees the coroutines reach the remote source in the order their snapshots were taken. After two quick edits, the older snapshot can be written last, and the remote copy then misses the newer edit. A later refresh brings that stale state back into the app.
send uploads through one serialized worker that always sends the newest snapshot (a conflated channel, or a mutex around both the read and the save), or use unique WorkManager work with REPLACE.
Review: The scope is Dispatchers.Default (CoroutinesModule.kt:59), so reordering is possible. But each upload then queues on a FIFO mutex held for 2 s, and the overtaking window is under a millisecond against human-speed edits.
From the report
if (taskId == null) {
createNewTask()
} else {
saveTask() launches a new create coroutine on every call until navigation happens. Two quick taps on the save button store two identical tasks with different ids.
set an isSaving flag in the UI state synchronously before launching. Ignore saveTask() while that flag or isTaskSaved is set, and disable the button.
Review: There is no in-flight guard (AddEditTaskViewModel.kt:77-79, 102-107), and each call makes a new UUID. Landing two taps in the few-ms window is uncertain.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/TopAppBars.kt:166From the report
Icon(Icons.Filled.ArrowBack, stringResource(id = R.string.menu_back))
the add/edit bar (line 184) uses the auto-mirrored arrow, but the task-detail bar uses the deprecated fixed one. The manifest declares RTL support, so on the detail screen the arrow points the wrong way in right-to-left languages.
use Icons.AutoMirrored.Filled.ArrowBack in both bars, ideally through one shared back-button composable.
Review: Icons.Filled.ArrowBack at TopAppBars.kt:166 against Icons.AutoMirrored.Filled.ArrowBack at 184; supportsRtl="true" at AndroidManifest.xml:24.
From the report
fun provideTasksRepository(): TaskRepository {
return FakeTaskRepository()
}
every screen test and the "Large End-to-End test" (TasksTest.kt:51) replace the real repository with a fake. The real DefaultTaskRepository with Room and Hilt is never exercised as a whole. That is how defects such as findings 10, 11 and 26 stay invisible.
keep the fast fake-backed tests, and add at least one instrumented flow test that uses the real repository with the in-memory Room database. It should cover create, edit, delete and refresh.
Review: RepositoryTestModule provides FakeTaskRepository (line 36) for the instrumented and end-to-end tests. Unit tests use the real repository only with fake DAO and network.
From the report
localDataSource.deleteAll()
localDataSource.upsertAll(remoteTasks.toLocal())
if the process dies, the coroutine is cancelled, or the insert fails between the two calls, the local table is left empty. Screens observing the table also briefly see an empty list. The next mutation then uploads that empty list and overwrites the remote copy.
add one @Transaction DAO method (for example replaceAll(tasks)) or use withTransaction. Better still, upsert the new rows and delete only the ids that are missing.
Review: Two separate DAO calls with no transaction anywhere (confirmed). The window is milliseconds; the effect is a flicker plus a small integrity risk.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksViewModel.kt:140From the report
_isLoading.value = true
viewModelScope.launch {
taskRepository.refresh()
if refresh() throws because the remote source or the database fails, the exception is uncaught and crashes the app. At best the loading spinner never stops. The same shape appears in:
TaskDetailViewModel.refresh(line 111)StatisticsViewModel.refresh(line 63)AddEditTaskViewModel.updateTask(line 113), whose repository call deliberately throws when the task is missing
wrap each call in try/catch/finally. Reset the loading flag in finally, rethrow CancellationException, and turn other failures into a user message.
Review: The four launch blocks have no try/catch. The in-memory source never throws; the realistic trigger is updateTask on a vanished task (DefaultTaskRepository.kt:71).
From the report
cursorColor = MaterialTheme.colorScheme.onSecondary
in the light colour scheme used by TodoTheme, onSecondary is white. The fields sit on a near-white surface, so the cursor cannot be seen in either the title or the description field.
use a colour that contrasts with the field background, such as colorScheme.primary.
Review: cursorColor = onSecondary at line 136. TodoTheme (lines 11-15) overrides only primary, secondary and tertiary, so onSecondary stays white. Text and placeholders stay visible, so it is cosmetic.
From the report
LoadingContent(
...
modifier = modifier,
the screen passes modifier.padding(paddingValues) into StatisticsContent (line 63). That modifier goes to LoadingContent, and is then reused through commonModifier for the inner Column. The top-bar and system-bar insets are therefore applied twice, which leaves an extra blank band.
apply the passed modifier once, to the outer container, and build the inner Column's modifier from a fresh Modifier.
Review: modifier.padding(paddingValues) (StatisticsScreen.kt:63) reaches LoadingContent (line 85) and then commonModifier (77, 94). The result is an extra gap, in the non-empty state only.
From the report
@Query("SELECT * FROM task WHERE id = :taskId")
fun observeById(taskId: String): Flow<LocalTask>
the query is declared non-null, but the row can disappear. When the task is deleted, the query emits null and the repository's map { it.toExternal() } throws. The stream then ends in its generic "Error while loading task" state. The intended "Task not found" handling in TaskDetailViewModel.handleTask can never run.
declare Flow<LocalTask?> and map with it?.toExternal().
Review: observeById returns non-null Flow<LocalTask> (TaskDao.kt:45), so handleTask(null) is dead and the user sees the generic error. Real, but short-lived.
From the report
assertThat(networkDataSource.tasks?.map { it.id }?.contains(newTaskId))
assertThat(localDataSource.tasks?.map { it.id }?.contains(newTaskId))
neither assertion has a final check, so the test passes whatever the repository does. The "saves to local and remote" behaviour is not actually verified.
append .isTrue() to both lines, and let the background upload finish (advanceUntilIdle()) before checking the remote source.
Review: The defect is real: both assertThat(...contains(...)) lines have no terminal check (DefaultTaskRepositoryTest.kt:112-113). It is one test in a sample.
From the report
localDataSource = FakeTaskDao(mutableListOf(task1.toLocal()))
val initial = taskRepository.getTask(task1.id)
the repository still holds the DAO it was built with, so it never sees task1. Both reads return null, and the "caches after first call" assertion compares null with null. It cannot fail.
seed the existing fake (localDataSource.tasks = listOf(task1.toLocal())), or rebuild the repository after the change. Assert that initial is not null.
Review: Real: line 211 reassigns localDataSource after the repository was built with the old DAO, which holds only task3, so both reads are null and null equals null. One test, no user impact.
Info after review (8)
gradle.properties:19From the report
android.enableJetifier=true
every dependency is already AndroidX, so this pass only slows the build.
set it to false. Replace any legacy library that breaks rather than turning Jetifier back on.
Review: The setting is at line 19, but "every dependency is already AndroidX" cannot be established without resolving the dependency graph.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ComposeUtils.kt:25From the report
val primaryDarkColor: Color = Color(0xFF263238)
TodoDrawer.kt:119 paints the header with this constant, while the header text reads its colour from the theme. The two will drift apart as soon as the theme changes or a dark scheme is added.
use MaterialTheme.colorScheme.primary, which has the same value in TodoTheme, and remove the constant.
Review: The value is the same as the theme's primary (0xFF263238), used at TodoDrawer.kt:119, and works today. Duplication only.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/ModelMappingExt.kt:73From the report
fun LocalTask.toNetwork() = NetworkTask(
id = id,
title = title,
NetworkTask has a priority field, but the local model and both mappings drop it. Each upload replaces the whole remote list, so any priority a server sets would be erased on the next save. Nothing sets the field today, so this is latent.
carry priority through LocalTask (with a database migration) and both mappings, or stop the app from declaring a field it cannot round-trip.
Review: NetworkTask.priority is set nowhere, and the report admits it is latent.
From the report
localDataSource.deleteCompleted()
saveTasksToNetwork()
seven methods each repeat "write locally, then start an upload". A new write path can easily forget the second step, and fixing ordering or error handling means editing all seven.
route every mutation through one private helper that performs the local write and then schedules the sync.
Review: Seven methods call saveTasksToNetwork(), and all of them do. This is a refactoring suggestion, not a defect.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksViewModel.kt:80From the report
Async.Loading -> {
TasksUiState(isLoading = true)
}
the source flow only ever emits Success or Error, so this branch never runs. It suggests a loading phase that does not exist. The same applies in TaskDetailViewModel and StatisticsViewModel.
remove the branch, or emit Async.Loading with onStart if a loading phase is wanted.
Review: Confirmed unreachable: the flows emit only Success or Error, and the initial value covers loading. It is dead code with no user effect.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt:93From the report
Icon(Icons.Filled.Add, stringResource(id = R.string.add_task))
every screen reads strings straight from the bundled resources. If the product ever needs to correct wording without an app release, there is no single place to add an override.
if that is a need, route UI text through one small wrapper that checks an optional override map and falls back to the bundled resource. Otherwise this can be accepted as is.
Review: This is a hypothetical product need, and the report itself says "can be accepted as is". Standard stringResource use is not a defect.
From the report
uiState.userMessage?.let { userMessage ->
val snackbarText = stringResource(userMessage)
LaunchedEffect(snackbarHostState, viewModel, userMessage, snackbarText) {
the same block appears at TasksScreen.kt:112 and TaskDetailScreen.kt:84. The userMessage field and the snackbarMessageShown() / showSnackbarMessage() pair are also repeated in three ViewModels. A fix to one copy will not reach the others.
extract one composable, for example UserMessageEffect(message, hostState, onShown), and one shared message holder.
Review: The copies exist at AddEditTaskScreen.kt:98, TasksScreen.kt:112 and TaskDetailScreen.kt:84, but this is duplication in a sample.
app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksViewModel.kt:79From the report
when (tasksAsync) {
Async.Loading -> {
the same loading/error/success mapping, including the catch-to-error step, is hand-written in TasksViewModel, TaskDetailViewModel (line 69) and StatisticsViewModel (line 70). The copies have already diverged: statistics drops its error (finding 2).
put the mapping and the error conversion in one shared flow operator or helper.
Review: The when blocks exist at lines 79, 69 and 70. They build three different UiState types, and the statistics "divergence" is #2.