fexrift: a Meta sign-in is sessions/<user id>/, not any file in sessions/

On the Frame Meta's app framework created sessions/_oaf/data.sqlite as soon as the runtime started (the
install's runtime probe), so fex status said login: true without a sign-in. A real sign-in (PC prefix,
2026-10-09) adds sessions/<numeric Meta user id>/. fex login's done signal looked for files directly under
sessions/, which a real sign-in never has: it would have waited forever. One check (signed_in) for status,
fex login and the PC import.
This commit is contained in:
spoopyghosty0 committed 2026-10-15 23:52:41 -04:00
1 parent 3733a38e4e
commit 7dcb601792
6 files changed
+36 -7

No files matched your search

+8 -1
View File
@@ -431,6 +431,13 @@ def cmd_setup(args):
return {"done": done}
def signed_in(sessions):
"""A Meta sign-in = a session folder named by the numeric Meta user id (sessions/<id>/). Meta's app framework
creates sessions/_oaf as soon as the runtime starts, signed in or not (seen on the Frame, 2026-10-15)."""
return os.path.isdir(sessions) and any(n.isdigit() and os.path.isdir(os.path.join(sessions, n))
for n in os.listdir(sessions))
def cmd_status(args):
st = read_json(STATUS, {}) or {}
sessions = os.path.join(USER_DIR, "AppData", "Roaming", "Oculus", "sessions")
@@ -440,7 +447,7 @@ def cmd_status(args):
"proton": os.path.isfile(os.path.join(GE, ".fp-verified")), "fex": os.path.isdir(FEX_DIR),
"prefix": os.path.isfile(os.path.join(PFX, "system.reg")),
"meta": read_json(os.path.join(META_DIR, ".fp-meta.json")),
"login": os.path.isdir(sessions) and bool(os.listdir(sessions)), "apps": apps}
"login": signed_in(sessions), "apps": apps}
# ------------------------------------------------------------------------------------------------ login import
+1 -1
View File
@@ -165,7 +165,7 @@ cd {q(str(Path(CORE.META_DIR) / 'Support/oculus-client'))}
def signed_in():
sessions = Path(CORE.PFX) / "drive_c/users/steamuser/AppData/Roaming/Oculus/sessions"
return sessions.is_dir() and any(p.is_file() and p.stat().st_size for p in sessions.iterdir())
return CORE.signed_in(str(sessions)) # sessions/<numeric user id>/, not Meta's _oaf framework folder
def running(name):
+3 -1
View File
@@ -140,7 +140,9 @@ def setup(frame, reporter: Reporter, wait: float = 3600) -> dict:
def find_user_dir(prefix: Path) -> Path:
users = prefix / "drive_c" / "users"
for u in sorted(users.iterdir()) if users.is_dir() else []:
if (u / "AppData" / "Roaming" / "Oculus" / "sessions").is_dir():
sessions = u / "AppData" / "Roaming" / "Oculus" / "sessions"
# signed in = sessions/<numeric Meta user id>/ (Meta's app creates sessions/_oaf without a sign-in)
if sessions.is_dir() and any(p.is_dir() and p.name.isdigit() for p in sessions.iterdir()):
return u
raise RuntimeError(f"no Meta login in {prefix} (sign in with Meta's app in that prefix first)")
+8 -3
View File
@@ -112,9 +112,13 @@ def test_memory_only_fallback_and_status_transitions(ext, monkeypatch):
assert broker.handle({"op": "callback", "url": CALLBACK}) == {"delivered": True}
sessions = Path(ext.CORE.PFX) / "drive_c/users/steamuser/AppData/Roaming/Oculus/sessions"
sessions.mkdir(parents=True)
# real layout: Meta's app creates sessions/_oaf when the runtime starts, a sign-in adds sessions/<user id>/
(sessions / "_oaf").mkdir()
(sessions / "_oaf" / "data.sqlite").write_text("framework")
(sessions / "empty").touch()
assert not ext.status({})["signed_in"]
(sessions / "fake").write_text("test session")
(sessions / "1234567890").mkdir()
(sessions / "1234567890" / "data.sqlite").write_text("test session")
st = ext.status({})
assert st["signed_in"] and st["page_opened_at"] and st["callback_received_at"]
assert_no_credentials(ext.folder())
@@ -202,7 +206,8 @@ def test_cleanup_keeps_sessions_and_retries_after_failure(ext, monkeypatch):
path.write_text(json.dumps({"browser": None, "files": {}}))
sessions = Path(ext.CORE.PFX) / "drive_c/users/steamuser/AppData/Roaming/Oculus/sessions"
sessions.mkdir(parents=True)
(sessions / "fake").write_bytes(b"test session")
(sessions / "1234567890").mkdir()
(sessions / "1234567890" / "fake").write_bytes(b"test session")
monkeypatch.setattr(ext, "request", lambda msg: (_ for _ in ()).throw(OSError()))
monkeypatch.setattr(ext.CORE, "wineserver_kill", lambda: (_ for _ in ()).throw(OSError()))
with pytest.raises(OSError):
@@ -210,7 +215,7 @@ def test_cleanup_keeps_sessions_and_retries_after_failure(ext, monkeypatch):
assert path.exists()
monkeypatch.setattr(ext.CORE, "wineserver_kill", lambda: None)
assert ext.stop({})["signed_in"] and not path.exists()
assert ext.stop({})["signed_in"] and (sessions / "fake").read_bytes() == b"test session"
assert ext.stop({})["signed_in"] and (sessions / "1234567890" / "fake").read_bytes() == b"test session"
def test_stop_signals_launcher_before_wine_and_registry(ext, monkeypatch):
+5 -1
View File
@@ -333,8 +333,12 @@ def test_login_archive(tmp_path):
pfx = tmp_path / "pfx"
user = pfx / "drive_c/users/someone/AppData/Roaming/Oculus/sessions"
user.mkdir(parents=True)
(user / "_oaf").mkdir(parents=True) # Meta's framework folder alone isn't a sign-in
with pytest.raises(RuntimeError, match="sign in"):
fexrift.login_archive(pfx, ["oculus-first-contact"], tmp_path / "l0.tar")
user.mkdir(parents=True, exist_ok=True)
(user / "token").write_text("secret")
(user / "1234567890").mkdir()
meta = pfx / "drive_c/Program Files/Meta Horizon"
(meta / "CoreData").mkdir(parents=True)
(meta / "CoreData" / "x").write_text("1")
+11
View File
@@ -62,3 +62,14 @@ def test_artifact_files_include_extensions_and_data():
rels = {rel for _, rel in fexrift.artifact_files()}
assert {"fexrift.py", "fexrift_games.json"} <= rels
def test_signed_in_needs_a_user_id_folder(monkeypatch, tmp_path):
fx = load_copy(monkeypatch, tmp_path)
sessions = tmp_path / "sessions"
assert not fx.signed_in(str(sessions))
(sessions / "_oaf").mkdir(parents=True)
(sessions / "_oaf" / "data.sqlite").write_text("x") # what the runtime alone creates
assert not fx.signed_in(str(sessions))
(sessions / "1368740236322643").mkdir()
assert fx.signed_in(str(sessions))