• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dcdpr / jp / 28154594752
69%

Build:
DEFAULT BRANCH: main
Ran 25 Jun 2026 07:41AM UTC
Jobs 1
Files 420
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jun 2026 07:37AM UTC coverage: 66.921% (+0.05%) from 66.868%
28154594752

push

github

web-flow
fix(workspace): Prevent session file collisions via source-prefixed keys (#792)

Two sessions sharing a value but differing in source — e.g.
`$JP_SESSION=1234` alongside `$TMUX_PANE=1234`, or an `Env` value that
matched a session-leader PID — resolved to the same `1234.json` file,
causing one session to silently overwrite the other's active
conversation.

The filename now encodes both the session value and its source:

- `getsid-<pid>.json`
- `hwnd-<handle>.json`
- `env-<KEY>-<hash(value)>.json`

The opaque `Env` value is SHA-256 hashed (first 16 hex chars) so
distinct variables holding the same value are kept apart and unsafe
characters are excluded from the filename.

The session id is now stored inside the mapping itself, making each file
self-describing. Stale detection decodes the id via typed
`SessionId::as_pid` / `SessionId::as_hwnd` methods — inverses of the
encoding in `Session::getsid` / `Session::hwnd` — instead of parsing the
filename string. This closes the silent failure where a debug-formatted
HWND (`0x...`) was stored but later parsed as decimal, yielding
`Unknown` liveness and disabling stale detection.

`Session::getsid` and `Session::hwnd` now accept the raw typed value
(`i32` / `isize`) and own the encoding, keeping encode and decode in
sync by construction. `jp_cli` passes the raw platform handle directly.

Existing bare-value files are handled without data loss: reads fall back
to the legacy key when the source-prefixed key is absent, and stale-file
cleanup migrates surviving legacy files to their new name in one pass.

---------

Signed-off-by: Jean Mertz <git@jeanmertz.com>

135 of 159 new or added lines in 3 files covered. (84.91%)

36338 of 54300 relevant lines covered (66.92%)

423.04 hits per line

Uncovered Changes

Lines Coverage ∆ File
23
82.1
3.33% crates/jp_workspace/src/session_mapping.rs
1
89.23
24.52% crates/jp_workspace/src/session.rs
Jobs
ID Job ID Ran Files Coverage
1 28154594752.1 25 Jun 2026 07:41AM UTC 420
66.92
GitHub Action Run
Source Files on build 28154594752
  • Tree
  • List 420
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28154594752
  • aab1e6ef on github
  • Prev Build on main (#28132893375)
  • Next Build on main (#28166211544)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc