Skip to content

A launcher-icon switch whose caller is cancelled leaves the app naming the old icon #387

Closed

Description

@lumenpearson

What is broken

On branch android/app-icons, AppIconStore.switchTo published the new icon (state.value = target) only after locked { aliases.switchTo(target) } returned.

Failure scenario

  1. The coroutine that pressed «Применить» is cancelled while the platform write is running on the IO dispatcher. For example, the page's scope ends mid-switch.
  2. The write completes, but withContext throws CancellationException when it resumes, so the assignment never runs.
  3. For the rest of the process, current names the old icon while the launcher shows the new one. The row on «Оформление», «О приложении» and the page itself all show the old icon. «Применить» stays enabled for the icon already applied.

refresh and reconcile had the same ordering. That also let an earlier read overwrite a later switch's value.

How it was found

The review of task 4 of docs/specs/2026-10-09-app-icons-plan.md found it. This never reached main.

Fix

d082a2e on android/app-icons assigns the value inside the locked block, right after the write it publishes. Its test cancels the job in the middle of the platform write. The pull request for that branch closes this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions