Skip to content

Fix: Wire InterfaceMode into reticulum-kt interfaces - #1182

Closed
Cryptoteep wants to merge 3 commits into
torlando-tech:mainfrom
Cryptoteep:fix/issue-1169
Closed

Cryptoteep wants to merge 3 commits into
torlando-tech:mainfrom
Cryptoteep:fix/issue-1169

Conversation

@Cryptoteep

Copy link
Copy Markdown

Fixes #1169

This wires the user-selected interface mode into the reticulum-kt interface objects for the Kotlin backend, addressing the issue where modes were silently dropped.

What's done:

  • Added an enum mapping from Columba's string-valued InterfaceMode to network.reticulum.common.InterfaceMode.
  • INTERNAL mode is temporarily mapped to POINT_TO_POINT as a fallback with a warning log, pending the resolution of reticulum-kt issue Support for Encrypted Paper Messages (lxm:// URI Handler) #91.
  • Set modeOverride on TCPClientInterface, TCPServerInterface, UDPInterface, AutoInterface in NativeInterfaceFactory.kt.
  • Set modeOverride on RNodeInterface in RNodeConnectionHelper.kt for SPP/USB/TCP.
  • Added a unit test (NativeInterfaceFactoryModeTest) that asserts the constructed interface object carries the expected mode.

Fixes torlando-tech#1169

This wires the user-selected interface mode (string) to the reticulum-kt InterfaceMode enum by setting modeOverride on TCPClientInterface, TCPServerInterface, UDPInterface, AutoInterface, and RNodeInterface.
INTERNAL mode is mapped to POINT_TO_POINT as a fallback pending reticulum-kt#91. A unit test verifies the mode propagation.

Signed-off-by: Andreev Kirill Andreevich <andreev.gh2017@yandex.ru>
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Wires interface mode configuration into network interface objects.

The PR is not ready to merge: Ubuntu builds are blocked, and saved mode changes still leave running interfaces unchanged.

Findings

  1. P1 Ubuntu builds cannot start ▶
  2. P1 Saved mode stays inactive ▶
  3. P2 Mode test needs a connection ▶
Fix with agent prompt
### Issue 1
gradle.properties:1
`gradle.properties` now points Gradle to a Windows-only Java path. CI runs Gradle on Ubuntu, where that path does not exist, so builds and tests cannot start. Remove the machine-specific path and let each environment use its configured JDK.

### Issue 2
rns-backend-kt/src/main/kotlin/network/columba/app/rns/backend/kt/NativeInterfaceFactory.kt:undefined-391
When a user changes the mode of an enabled interface, `reloadInterfaces` calls `syncInterfaces`, which keeps the running interface if its name is unchanged. The new `modeOverride` is set only when an interface is created. The user sees the change saved, but the interface keeps its old mode until it restarts. Recreate the interface when its mode changes.

### Issue 3
rns-backend-kt/src/test/kotlin/network/columba/app/rns/backend/kt/NativeInterfaceFactoryModeTest.kt:31-36
The test starts a real `TCPClient` at `127.0.0.1:1234` without starting a server. If that port is unavailable and `start()` throws, the factory never tracks the interface. The test then fails before it can check the mode. Test the mapping without a live connection, or start a server in the test.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The Kotlin backend now passes saved interface modes into Reticulum objects, translating Columba’s strings to the library’s enum. INTERNAL maps to POINT_TO_POINT with a warning, and gradle.properties is replaced with a fixed Windows JDK path.

  • Kotlin interfaces now use the mode selected in Columba.
  • Gradle now uses a fixed Windows JDK installation.

Reviews (2) · Last reviewed commit: "Fix: Add point_to_point mapping to Inter..."

ifacNetkey = config.passphrase,
)
).apply {
modeOverride = mapInterfaceMode(config.mode)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Saved mode stays inactive

When a user changes the mode of an enabled interface, reloadInterfaces calls syncInterfaces, which keeps the running interface if its name is unchanged. The new modeOverride is set only when an interface is created. The user sees the change saved, but the interface keeps its old mode until it restarts. Recreate the interface when its mode changes.

Prompt To Fix With AI
This is a comment left during a code review.
Path: rns-backend-kt/src/main/kotlin/network/columba/app/rns/backend/kt/NativeInterfaceFactory.kt
Line: 391

Comment:
**Saved mode stays inactive**

When a user changes the mode of an enabled interface, `reloadInterfaces` calls `syncInterfaces`, which keeps the running interface if its name is unchanged. The new `modeOverride` is set only when an interface is created. The user sees the change saved, but the interface keeps its old mode until it restarts. Recreate the interface when its mode changes.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +30 to +35
targetHost = "127.0.0.1",
targetPort = 1234,
mode = modeString
)

NativeInterfaceFactory.restartInterface(config)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Mode test needs a connection

The test starts a real TCPClient at 127.0.0.1:1234 without starting a server. If that port is unavailable and start() throws, the factory never tracks the interface. The test then fails before it can check the mode. Test the mapping without a live connection, or start a server in the test.

Prompt To Fix With AI
This is a comment left during a code review.
Path: rns-backend-kt/src/test/kotlin/network/columba/app/rns/backend/kt/NativeInterfaceFactoryModeTest.kt
Line: 30-35

Comment:
**Mode test needs a connection**

The test starts a real `TCPClient` at `127.0.0.1:1234` without starting a server. If that port is unavailable and `start()` throws, the factory never tracks the interface. The test then fails before it can check the mode. Test the mapping without a live connection, or start a server in the test.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread gradle.properties
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
org.gradle.java.home=C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.20.101-hotspot

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Ubuntu builds cannot start

gradle.properties now points Gradle to a Windows-only Java path. CI runs Gradle on Ubuntu, where that path does not exist, so builds and tests cannot start. Remove the machine-specific path and let each environment use its configured JDK.

Prompt To Fix With AI
This is a comment left during a code review.
Path: gradle.properties
Line: 1

Comment:
**Ubuntu builds cannot start**

`gradle.properties` now points Gradle to a Windows-only Java path. CI runs Gradle on Ubuntu, where that path does not exist, so builds and tests cannot start. Remove the machine-specific path and let each environment use its configured JDK.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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.

Kotlin backend: mode is silently dropped for all interface types (TCP, RNode/SPP, UDP)

2 participants