Skip to content

refactor(session): split the 2,500-line session by what a job is about - #61

Merged
ewanc26 merged 1 commit into
mainfrom
refactor/split-session
Oct 7, 2026
Merged

ewanc26 merged 1 commit into
mainfrom
refactor/split-session

Conversation

@ewanc26

@ewanc26 ewanc26 commented Oct 7, 2026

Copy link
Copy Markdown
Owner

What this changes

src/atproto/session.c was 2,567 lines: the worker, 27 job runners, their submit_ calls, the result accessors, and a second copy of the whole interface as a no-network stand-in. It is now session.c (256 lines: the thread, the lock, the event hand-off, the queue), with the jobs split by what they are about: session_auth.c, session_view.c (Wolfram views to Indigo's post, actor and notification types), session_read.c, session_people.c, session_lists.c and session_write.c, sharing session_internal.h. The thirty file-scope statics are one g_session block, and the stand-in is session_stub.c. Bodies moved verbatim apart from those renames and indigo_session_ prefixes on what crosses files. Part of the atomic-files rule; app.c and layout.c are next. Part of #53.

Verification

The 3DS build (devkitARM, against a Wolfram v0.34.0 build) links with no warnings, and every file also compiles on the host in strict mode with no 3DS (empty for the real ones, the stand-in for session_stub.c). make test passes (4019 checks, 0 failures). The host tests do not compile the real session, so the 3DS build and CI are the check; nothing ran on Azahar or a 3DS, where the worker thread is what could regress.

Docs

AGENTS.md names the new files.

Changelog: none — an internal reorganisation with no change a player sees.

Checklist

  • CI is green (CI gate and flow / conventions)
  • No secrets, tokens or signing keys in the diff
  • Tests added or changed with the behaviour; none skipped, disabled or deleted

🤖 Generated with Claude Code

session.c keeps the worker and the queue; the jobs move to session_auth,
session_view, session_read, session_people, session_lists and session_write,
sharing session_internal.h, and the no-network stand-in becomes session_stub.
No behaviour change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ewanc26
ewanc26 merged commit 28db9ea into main Oct 7, 2026
9 checks passed
@ewanc26
ewanc26 deleted the refactor/split-session branch October 7, 2026 08:22
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