Skip to content

Task 028: Extract WebSocket logic into useSocket composable - #28

Merged
Igloczek merged 2 commits into
masterfrom
task/028-extract-socket-composable
Jun 30, 2026
Merged

Igloczek merged 2 commits into
masterfrom
task/028-extract-socket-composable

Conversation

@Igloczek

@Igloczek Igloczek commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements tasks/028-extract-socket-composable.md from the ponytail audit backlog.

Goal

Move connection lifecycle and event handlers out of the 897-line mixin into a composable without changing UI behavior.

Scope

  • Create src/composables/useSocket.ts with connect/disconnect, emit/on wrappers, and reconnection logic extracted from src/mixins/socket.ts.
  • Mixin delegates to composable during transition (do not remove mixin yet).
  • No Pinia required in this phase.

Acceptance criteria

  • socket.ts mixin shrinks by at least 200 LOC.
  • Dashboard still receives real-time heartbeat updates after login.
  • Login/logout socket flows unchanged.
  • bun run lint passes.
  • bun run test-e2e passes.

Depends on

Nothing.

Verification

bun run lint
bun run test-e2e
wc -l src/mixins/socket.ts src/composables/useSocket.ts

Audit reference

Finding #4 — socket mixin (phase 1).

@Igloczek

Copy link
Copy Markdown
Collaborator Author

/ponytail-review

useSocket.ts:L81-L92: yagni — socketOn/disconnectSocket have no callers yet; kept intentionally as the phase-1 public surface for task 029.

net: 0 lines possible (extraction is inherently a move, not a deletion pass).

Closes task 028.

2 files changed, 328 insertions(+), 262 deletions(-)

Igloczek added a commit that referenced this pull request Jun 30, 2026
Type schema migrations against BunSQLiteRedbean directly and use
bun:sqlite Database in migration helpers. Deletes the single-implementor
MigrationStore interface (ponytail audit #28).
@Igloczek
Igloczek force-pushed the task/028-extract-socket-composable branch from b17bf14 to 773cb9d Compare June 30, 2026 12:11
Igloczek added 2 commits June 30, 2026 14:27
Move connection setup, event handlers, and emit/on wrappers out of the
897-line socket mixin into src/composables/useSocket.ts. The mixin keeps
state, computed properties, and auth/API methods but delegates init and
socket I/O to the composable during the phase-1 transition.

Mixin shrinks by 233 LOC (897 → 664).
@Igloczek
Igloczek force-pushed the task/028-extract-socket-composable branch from 773cb9d to 3dc697a Compare June 30, 2026 12:28
@Igloczek
Igloczek merged commit 5b1a994 into master Jun 30, 2026
1 check passed
@Igloczek
Igloczek deleted the task/028-extract-socket-composable branch June 30, 2026 12:59
Igloczek added a commit that referenced this pull request Aug 8, 2026
Type schema migrations against BunSQLiteRedbean directly and use
bun:sqlite Database in migration helpers. Deletes the single-implementor
MigrationStore interface (ponytail audit #28).
Igloczek added a commit that referenced this pull request Aug 8, 2026
Task 028: Extract WebSocket logic into useSocket composable
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