|
Ran
|
Jobs
1
|
Files
88
|
Run time
1min
|
Badge
README BADGES
|
push
github
Backport: Harden the single-instance IPC (#1709) (#1728) * Harden the single-instance IPC (#1682) A socket file left behind by a crashed QtPass made QLocalServer::listen() fail with "address in use"; the return value was ignored, so the new instance ran without a server and every later launch silently exited after a failed sendMessage(). Launcher clicks did nothing until the user deleted the file by hand. - Probe the socket when the shared memory segment attaches; when nobody answers the segment is stale (System V shm outlives a crashed process), detach and take over instead of forwarding into the void. - removeServer() before listen(), set UserAccessOption so only the owning user can connect, and qWarning() when listen() still fails. - Read accepted sockets asynchronously: a peer that connects without sending anything no longer blocks the GUI thread for a second, an empty connection is not reported as a message, and every accepted QLocalSocket is deleted once the peer disconnects. - main() falls through to a normal start when sendMessage() fails instead of exiting silently. QSharedMemory stays: its exclusive create() still arbitrates two simultaneous launches, which a socket probe alone cannot do once UserAccessOption makes listen() rename over an existing socket path. New tst_singleapplication plants a stale socket file before constructing the application and checks that a client can connect, that the socket is 0700, that messages (and the empty-payload NUL) arrive, that a silent peer emits nothing and leaks nothing, and that the first instance reports isRunning() == false. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuQsrHonihp1nARE7bzstc (cherry picked from commit 38d387321) * Address review: take over when the peer dies mid-forward - SingleApplication::sendMessage(): when forwarding fails, clear _isRunning, detach the shared-memory se... (continued)
40 of 54 new or added lines in 1 file covered. (74.07%)
1 existing line in 1 file now uncovered.5003 of 7338 relevant lines covered (68.18%)
66.29 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 14 |
73.33
|
73.33% | src/singleapplication.cpp |
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
73.33
|
73.33% | src/singleapplication.cpp |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 34835706449.1 | 88 |
68.18
|
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|