Skip to content

APN Service continues connecting attempts after system "Forget VPN" (onRevoke not handled) #164

Description

@Jelikton

Steps to reproduce:

  1. Open APN VPN app and connect to VPN (status becomes "Connected").
  2. Go to system settings → Network & internet → VPN → tap "Forget" (or disconnect) for the APN VPN profile.
  3. Return to the app.

Expected result:
App immediately switches to "Disconnected" state and stops all connection attempts.

Actual result:
App continues to show "Connecting..." status and keeps sending network requests. Logs show repeated Connecting... lines and ConnectException: Network is unreachable errors after the system has revoked the VPN profile.

Logs (example):
07-16 01:57:27.157 1407 9782 W APN : Непредвиденная ошибка ConnectException: «Network is unreachable»
07-16 01:57:31.148 1407 1407 I APN : Connecting...
07-16 01:57:31.197 1407 9782 W APN : Непредвиденная ошибка ConnectException: «Network is unreachable»
...

Root cause (based on code analysis):
In APNService.onRevoke() the connection flag (f9588i) is not reset and ongoing coroutines are not cancelled, so the service keeps retrying to reconnect even after the system has removed the VPN profile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions