clickoneclickone
Back to blog
Product

clickone 1.1.4: no more stutter on auto-login, Android crash fixed

October 26, 20266 min read
By clickone Product Team· Billing model & client appsLast updated

Key takeaways

  • Fixed the crash that killed Android during auto-login. The root cause was an uncaught Go panic crossing the cgo boundary
  • The login page now enters the auto-login state on its first frame instead of showing an interactive form that does nothing
  • All 20 exported bridge functions now recover from panics, and crash output is written to a file instead of stderr
  • A read/write lock removed the race between the stats poller and instance shutdown, which matters more than the recovery layer

1.1.4 is a stability release with no new features. It fixes two things users hit every day: the Android crash during auto-login, and the feeling that the login page hangs for a second while the session is being restored.

What auto-login used to look like

Opening the app dropped you on a complete, interactive login form (empty email, empty password), and about a second later the email filled itself in and the screen switched to the home page. On a slow network that window stretched to two or three seconds. During it you saw a form waiting for input, and tapping sign in did nothing, because the session restore was already running in the background. It looked like a freeze.

In 1.1.4, whenever a restorable session exists on disk, the login page enters the auto-login state on its first frame. The button reads "Auto signing in…" and stays disabled, and the password field shows masking dots appearing one by one (the same character and spacing as manual input, so nothing jumps. You see an operation in progress instead of a form that ignores you.

Your password was never stored

This fill animation is cosmetic. The client only persists the access and refresh tokens; the password itself never touches disk. When auto-login fails and falls back to manual input, the animation clears immediately, otherwise those dots would suggest the password is already filled in and ready to submit.

The Android crash: no logs at all

The other report was worse. On Android the first launch of the day would crash, sometimes dying halfway through the automatic password entry, and a second attempt would work fine. It was intermittent and hard to reproduce.

The system tombstone told a clear story: the signature was SIGABRT, the stack sat on runtime.raise inside libxray_bridge.so, and the memory dump carried Go runtime symbols such as runtime.abort, goexit, and gcWriteBarrier. That means an uncaught panic on the Go side crossed the cgo boundary and the runtime aborted the whole process. Android release builds discard stderr, so not a single byte of the Go fatal output reached logcat. That is why the bug kept coming back without anyone being able to point at a line.

The trigger turned out to be a race. The stats poller reads the instance counters once a second, while stopping or hot-replacing the config closes that same instance on another thread. xray-core's stats manager keeps its counters in a plain map, and reading it while it is being torn down produces a fatal error that Go cannot recover from. Auto-login re-applies the config, which is exactly what collides with the poller.

Three fixes

  1. 1

    Recover on every exported function

    The bridge had 19 exports, and a panic in any one of them aborted the process. Each now captures the panic in a deferred call, records it as lastError, and returns a failure value. Dart gets an ordinary error instead of a vanished process. A twentieth export sets the crash log path.

  2. 2

    Serialize instance lifetime with a read/write lock

    Stats reads hold the read lock for their full duration; stop and hot-replace hold the write lock while closing the instance. The window where a closed instance could be read is gone. This layer matters more than recovery: if the panic can be prevented, recovery should never be the plan.

  3. 3

    Write crash output to disk

    Using the Go runtime's SetCrashOutput, fatal output is redirected into the app's private directory (files/xray_bridge_crash.log on Android). These crashes used to be completely invisible in release builds; now a full stack is captured whenever one happens.

Verification

On a physical Android device, eight consecutive cold launches all survived. The newest tombstone is still the one recorded before the fix, with nothing new after it, and the startup log confirms the crash log path was attached.

Upgrading keeps you signed in

Installing over the old version preserves the local session. The first launch signs in automatically, no password required.

How to upgrade

1.1.4 covers Windows, macOS, and Android. iOS uses third-party clients such as Streisand and has no client update in this release.

Frequently asked questions

Why is the password field empty after auto-login fails?
That is deliberate. A failed auto-login means you have to type it yourself; leaving the dots there would suggest the password is filled and ready, and submitting would send an empty value and fail. Clearing it is less misleading.
Can it still crash after upgrading?
The race behind the auto-login crash is removed at the source, and an exception anywhere in the bridge now becomes a readable error instead of a terminated process. If you still see a crash, send support the approximate time and device model (the local crash log will help us pin it down.
Does this affect desktop users who turned auto-login off?
No. With auto-login disabled, the login page is interactive from the first frame and no fill animation appears. This change only affects the case where auto-login is on.

Stability work has no screenshots to show. Users only remember that the app sometimes closes itself. That is why it gets its own post: what happened, and which layer it was fixed at. If anything still looks wrong after upgrading, tell support when it happened and what you were doing. We will take it from there.

About the author

clickone Product Team

Billing model & client apps

Pay for what you use, like water and electricity.

We are the clickone product team. We own the billing model and the client apps.

More from this team