Skip to content

fix(steam): stop marking working sessions as expired - #133

Merged
klNuno merged 2 commits into
mainfrom
fix/steam-session-mark
Nov 22, 2026
Merged

klNuno merged 2 commits into
mainfrom
fix/steam-session-mark

Conversation

@klNuno

@klNuno klNuno commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Note

Clanker Claude Opus 5.5 is responding on behalf of meetsu

Problem

After a Steam switch, accounts whose saved session works fine were marked "Session expired".

Current Steam no longer writes a MostRecent key in config/loginusers.vdf. On a real install, none of the 85 entries has one. Each entry only has AccountName, PersonaName, RememberPassword, WantsOfflineMode, SkipOfflineModeWarning, AutoLogin and Timestamp.

The post-switch watch only concluded "signed in" when the timestamp advanced and MostRecent was "1". With the key missing, every read while Steam ran said "not signed in". After two reads the watch concluded "refused" and stored an expired mark.

Fix

  • LoginEntry.most_recent is now Option<bool>, and None means the key is absent.
  • A timestamp that moved past the pre-switch one now means "signed in" on its own. An explicit MostRecent "0" still vetoes it.
  • When reading Steam marks, a stored "expired" mark is dropped if its detected_at is older than the account's last sign-in Timestamp. Steam has signed that account in since, either from accshift or by hand. This also clears the wrong marks already stored by 2.0.0.

Tests

  • a_sign_in_without_any_most_recent_key_reads_signed_in uses a fixture in the current Steam format. It failed before the fix (left: NotSignedIn, right: SignedIn).
  • an_expired_mark_older_than_the_last_sign_in_is_stale failed before the fix.
  • an_expired_mark_from_before_the_last_steam_sign_in_is_not_shown runs end to end through platform_marks, with path_override pointing at a temporary Steam folder.
  • build-safe node scripts/gates.mjs exits 0: fmt, clippy, rust (2040 passed, 0 failed), worker, bundle and streamdeck all pass.

Not verified: a real switch on a live Steam client.

Summary by CodeRabbit

  • Bug Fixes
    • Expired Steam session marks are now cleared from the displayed marks when the account has signed in again.
    • Steam sign-in detection now handles login history entries that omit the “Most Recent” flag.
    • Steam sign-in timestamps are available to support accurate session status.

Current Steam writes no MostRecent key in loginusers.vdf, so the post-switch
watch never saw a sign-in and marked every switched account expired. The
advanced Timestamp now decides alone; a MostRecent "0" still vetoes. A stored
expired mark older than the account's last sign-in is no longer shown.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6eed0b05-6534-41ac-a505-c2f21f31667d
Commits

Reviewing files that changed from the base of the PR and between 0bd0d66 and 8b8a198.

Files selected for processing: 2

  • crates/accshift-core/src/platforms/session_marks.rs
  • crates/accshift-core/src/platforms/steam/tests.rs

No actionable comments were generated in the recent review.

Walkthrough

Steam login parsing now distinguishes an absent MostRecent key from explicit values. Steam sign-in timestamps identify stale expired marks, which are removed before platform marks are merged with offline marks.

Changes: Steam session mark filtering

Layer / File(s) Summary
Parse Steam sign-in history
crates/accshift-core/src/platforms/steam/session.rs, crates/accshift-core/src/platforms/steam/session_tests.rs
LoginEntry preserves an absent MostRecent value. Sign-in detection uses timestamps when the key is absent, and new tests cover that behavior and stale-mark checks.
Filter stale expired marks
crates/accshift-core/src/platforms/steam/mod.rs, crates/accshift-core/src/platforms/session_marks.rs, crates/accshift-core/src/platforms/steam/tests.rs
Steam sign-in timestamps are read from the resolved Steam path. platform_marks removes stale Expired entries before merging marks. A test covers filtering marks for two Steam accounts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 0bd0d

This change stops working Steam sessions from being shown as expired when current Steam omits the MostRecent key. It also hides stale expired marks that predate the last sign-in. The change is covered by unit and end-to-end tests. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix and the affected area: Steam sessions were wrongly marked expired. The changeset makes LoginEntry.most_recent optional, treats an advanced Timestamp as sign-in, and drops store…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix and the affected area: Steam sessions were wrongly marked expired. The changeset makes LoginEntry.most_recent optional, treats an advanced Timestamp as sign-in, and drops stored expired marks that predate the last sign-in. The title matches the main change, and its conventional-commit prefix is clear.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68c45e1e-1a45-4cdd-aa0c-f7e8c5015b84
Commits

Reviewing files that changed from the base of the PR and between 537b14c and 0bd0d66.

Files selected for processing: 5

  • crates/accshift-core/src/platforms/session_marks.rs
  • crates/accshift-core/src/platforms/steam/mod.rs
  • crates/accshift-core/src/platforms/steam/session.rs
  • crates/accshift-core/src/platforms/steam/session_tests.rs
  • crates/accshift-core/src/platforms/steam/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@mtsu-patrol mtsu-patrol Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

@mtsu-patrol

mtsu-patrol Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Note

Head 8b8a198 was not reviewed again: the review of 0bd0d66 found no critical or major issue and only 29 lines changed since. Comment @mtsu-patrol review to review it.

This fixes Steam accounts with working saved logins being shown as session expired. The login history no longer includes a MostRecent key, so the old check never saw a successful sign-in. Stored expired marks are now also dropped when the account has signed in since the mark was recorded.

No comments posted: the reviewers raised no finding.

Review details
  • Model: muse-spark-1.3-contributor
  • Compared commits: 537b14c to 0bd0d66
  • Execution: tests could run in a disposable Linux sandbox
  • Files reviewed: 5 of 5
  • Duration: 1 min 48 s
Commands run (11)

Could not execute tests: no cargo/rustc in PATH or common cache locations, and rustup download to /tmp did not persist between execution calls so toolchain install under /work was not completed. Only static directory/README/Cargo metadata listing and diff inspection succeeded. Steam session-mark fix was not runtime-verified.

failed · exit 1 · 0 s

ls -R /work | head -n 200; echo "---"; cat /work/README.md 2>/dev/null | head -n 200; echo "---"; cat /work/package.json 2>/dev/null | head -n 200; echo "---"; cat /work/Cargo.toml 2>/dev/null | head -n 200; echo "---"; ls /work/*.mjs /work/*.md 2>/dev/null; cat /work/AGENTS.md 2>/dev/null | head -n 200
[earlier output omitted]
session_marks.rs
steam
warnings.rs

/work/crates/accshift-app/src/platforms/steam:
api.rs
context_menu.rs
cs2.rs
friend_code.rs
mod.rs
settings_schema.rs
warnings.rs

/work/crates/accshift-app/src/real:
---
<a href="https://mtsu.dev"><img align="right" src="https://mtsu.dev/press/mtsu-icon-1024.png" width="48" alt="MTSU"></a>

<h1 align="center">
  <a href="https://github.com/klNuno/accshift/releases/latest">
    <img src="./.github/assets/social-card.png" alt="accshift: switch game accounts in one click. No passwords stored. Free and open source for Windows, macOS and Linux." width="100%" />
  </a>
</h1>

<p align="center">
  <a href="https://github.com/klNuno/accshift/releases/latest"><img src="https://img.shields.io/github/v/release/klNuno/accshift?display_name=tag&label=release&color=8b5cf6" alt="Latest release" /></a>
  <a href="https://github.com/klNuno/accshift/releases"><img src="https://img.shields.io/github/downloads/klNuno/accshift/total?color=8b5cf6" alt="Downloads" /></a>
  <a href="#supported-platforms"><img src="https://img.shields.io/badge/Windows%20%7C%20macOS%20%7C%20Linux-0078D6" alt="Windows, macOS and Linux" /></a>
  <a href="./LICENSE"><img src="https://img.shields.io/github/license/klNuno/accshift?color=0078D6" alt="License" /></a>
  <a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/Rust-egui-DEA584?logo=rust&logoColor=white" alt="Rust and egui" /></a>
</p>

<p align="center">
  <a href="#installation"><b>Download</b></a>
  &nbsp;·&nbsp;
  <a href="#features"><b>Features</b></a>
  &nbsp;·&nbsp;
  <a href="#supported-platforms"><b>Platforms</b></a>
  &nbsp;·&nbsp;
  <a href="#cli"><b>CLI</b></a>
  &nbsp;·&nb

passed · exit 0 · 0 s

git -C /work diff --stat HEAD~1 2>/dev/null || git -C /work log --oneline -5; echo "==="; git -C /work diff HEAD~1 -- crates/accshift-core/src/platforms/session_marks.rs crates/accshift-core/src/platforms/steam/mod.rs crates/accshift-core/src/platforms/steam/session.rs 2>&1 | head -n 300
echo "---GATES---"; cat /work/scripts/gates.mjs 2>/dev/null | head -n 200
echo "---CONTRIB---"; cat /work/.github/CONTRIBUTING.md 2>/dev/null | head -n 300

passed · exit 0 · 0 s

git -C /work diff HEAD~1 -- crates/accshift-core/src/platforms/session_marks.rs crates/accshift-core/src/platforms/steam/session.rs crates/accshift-core/src/platforms/steam/mod.rs 2>&1 | head -n 500
echo "===TESTS DIFF==="; git -C /work diff HEAD~1 -- crates/accshift-core/src/platforms/steam/session_tests.rs crates/accshift-core/src/platforms/steam/tests.rs 2>&1 | head -n 400

passed · exit 0 · 0 s

git -C /work diff HEAD~1 -- crates/accshift-core/src/platforms/session_marks.rs crates/accshift-core/src/platforms/steam/mod.rs 2>&1 | cat
echo "===READ session.rs watch_step==="; sed -n '1,160p' /work/crates/accshift-core/src/platforms/steam/session.rs

passed · exit 0 · 0 s

cargo test -p accshift-core --lib platforms::steam::session::tests -- --test-threads=1 --nocapture 2>&1 | tail -n 80
echo "===EXIT:$?"

passed · exit 0 · 0 s

which rustc; which cargo; ls ~/.cargo/bin/ 2>&1 | head -n 20; ls /root/.cargo/bin/ 2>&1 | head -n 20; ls /usr/local/cargo/bin/ 2>&1 | head -n 20; find / -maxdepth 5 -name cargo -type f 2>/dev/null | head; echo "---"; cat /work/rust-toolchain* 2>/dev/null; cat /work/Cargo.toml | head -n 60

passed · exit 0 · 0 s

echo $PATH; echo "---HOME $HOME"; ls -la ~ 2>&1 | head -n 50; echo "--- env"; env | sort | head -n 50; echo "--- find cargo broader"; find /opt /usr /home /work -name "cargo*" 2>/dev/null | head -n 20; ls /opt/ 2>&1 | head -n 20; ls /usr/local/bin/ 2>&1 | head -n 40

passed · exit 0 · 0 s

which curl wget bun node python3 2>&1; curl --version 2>&1 | head -n 2; df -h 2>&1 | head -n 10; free -m 2>&1 | head -n 10

passed · exit 0 · 0 s

mkdir -p /work/.patrol-home /tmp/cargo-home; export HOME=/work/.patrol-home CARGO_HOME=/tmp/cargo-home RUSTUP_HOME=/tmp/rustup-home; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup.sh; echo "downloaded $? size:"; ls -lh /tmp/rustup.sh; head -n 5 /tmp/rustup.sh

failed · exit 2 · 0 s

export HOME=/work/.patrol-home CARGO_HOME=/tmp/cargo-home RUSTUP_HOME=/tmp/rustup-home PATH=/tmp/cargo-home/bin:$PATH
mkdir -p $HOME $CARGO_HOME $RUSTUP_HOME
sh /tmp/rustup.sh -y --profile minimal --default-toolchain stable 2>&1 | tail -n 40
echo "EXIT:$?"
ls -lh /tmp/cargo-home/bin/ 2>&1 | head -n 20
sh: 0: cannot open /tmp/rustup.sh: No such file
EXIT:2
ls: cannot access '/tmp/cargo-home/bin/': No such file or directory

passed · exit 0 · 0 s

ls /work/ | head -n 50; echo "---check caches---"; ls -la /work/.cargo-home/bin 2>&1 | head; ls -la /work/.patrol-home 2>&1 | head; echo "---search host caches---"; ls /github 2>&1 | head; ls /opt/hostedtoolcache 2>&1 | head; find /usr /opt /github -maxdepth 6 -name "cargo" -type f 2>/dev/null | head; echo "---disk---"; df -h /work /tmp 2>&1 | head

@klNuno
klNuno merged commit 61fcb92 into main Nov 22, 2026
12 checks passed
@klNuno
klNuno deleted the fix/steam-session-mark branch November 22, 2026 16:15
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.

1 participant