Skip to content

fix(settings): remote admin always showed local node config#5560

Merged
jamesarich merged 1 commit into
mainfrom
jamesarich/laughing-invention
May 21, 2026
Merged

fix(settings): remote admin always showed local node config#5560
jamesarich merged 1 commit into
mainfrom
jamesarich/laughing-invention

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

Summary

Remote admin was broken -- tapping "Remote Admin" on any node navigated to the Settings screen but always displayed the local node's configuration instead of the remote target.

Root Cause

Koin 4.x's Navigation 3 ViewModelStoreNavEntryDecorator provides its own empty SavedStateHandle via CreationExtras, which silently overrode the one passed through parametersOf(SavedStateHandle(mapOf("destNum" to destNum))). The RadioConfigViewModel always received destNum = null from savedStateHandle.get<Int>("destNum"), causing it to treat every session as local.

Fix

Replace the SavedStateHandle indirection with a direct @InjectedParam private val destNum: Int? constructor parameter. This passes the destination node number reliably through Koin's DI without relying on SavedStateHandle population, which is incompatible with Nav 3's ViewModel scoping.

Verification

  • Confirmed on emulator: RadioConfigVM: init destNum=1887308340 and isLocal=false after the fix (previously destNum=null, isLocal=true)
  • All existing unit tests pass (:feature:settings:allTests, :feature:node:allTests)
  • Full assembleFdroidDebug build succeeds

…ectedParam

Koin 4.x's ViewModelStoreNavEntryDecorator provides its own empty
SavedStateHandle via CreationExtras, which overrode the one passed
through parametersOf(). This caused remote admin to always resolve
destNum=null, making the ViewModel treat every session as local.

Replace the SavedStateHandle indirection with a direct Int? parameter
annotated with @InjectedParam so the destNum is passed reliably
through Koin's dependency injection.

Fixes remote admin showing local node config instead of the target node.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the bugfix PR tag label May 21, 2026
@jamesarich jamesarich merged commit 41e3686 into main May 21, 2026
17 of 18 checks passed
@jamesarich jamesarich deleted the jamesarich/laughing-invention branch May 21, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant