Skip to content

DAC-146: Add unit tests for ClientConnection autoload#32

Merged
krazyjakee merged 1 commit into
masterfrom
feature/DAC-146-client-connection-tests
Mar 11, 2026
Merged

DAC-146: Add unit tests for ClientConnection autoload#32
krazyjakee merged 1 commit into
masterfrom
feature/DAC-146-client-connection-tests

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

Summary

  • Adds tests/unit/test_client_connection.gd with 20 unit tests for ClientConnection and related Client methods
  • Covers is_space_connected (connected/error/connecting/unknown)
  • Covers get_space_connection_status (all status strings)
  • Covers _all_failed (all error, one connected, empty, null slots)
  • Covers disconnect_server cache cleanup (space/channel/message/member/role caches, signals)
  • No AccordVoiceSession GDExtension dependency (client=null in connections)

Test plan

  • Unit tests pass (./test.sh unit)
  • Lint clean (gdlint scripts/ scenes/)
  • CI passing

Tests cover:
- is_space_connected: true/false for connected/error/connecting/unknown
- get_space_connection_status: returns correct status strings
- _all_failed: true when all error, false when one connected, true for empty/null
- disconnect_server: cleans space/channel/message/member/role caches
- disconnect_server: emits spaces_updated and server_removed signals

No AccordClient GDExtension dependency needed (client=null in connections).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@krazyjakee krazyjakee force-pushed the feature/DAC-146-client-connection-tests branch from 68648f6 to 0343c8b Compare March 11, 2026 10:28
@krazyjakee krazyjakee merged commit 636004b into master Mar 11, 2026
5 checks passed
@krazyjakee krazyjakee deleted the feature/DAC-146-client-connection-tests branch March 11, 2026 10:31
krazyjakee added a commit that referenced this pull request Jun 8, 2026
- #32: audit log gains action-type + user filters, cursor pagination
  (load-more), and live gateway prepend via onAuditLogCreate
- #33: reports queue gains status filter (All/Pending/Actioned/Dismissed),
  pagination, and inline delete-message/kick/ban actions that also action
  the report

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
krazyjakee added a commit that referenced this pull request Jun 14, 2026
…UI (#127) (#134)

* feat(voice): DM voice/video calls with ring/accept/decline (#127)

Adds 1:1 and group-DM calling on top of the existing channel-agnostic
voice stack, wiring the new server-side call signaling (accordserver #32).

accordkit:
- AccordCallSignal model + call.ring/decline/cancel/end gateway streams
- VoiceApi.ring / declineCall / cancelCall REST endpoints
- forwarded streams on AccordClient

client:
- CallController: outgoing call (join voice + ring), incoming ring state,
  accept (implicit join) / decline / cancel, and gateway-driven transitions
- call.* events wired through the per-connection event handler; a peer
  joining the ringing channel clears the "Calling…" state
- VoiceController.join accepts a null spaceId for DM calls
- call/video buttons in the DM conversation header; outgoing calls open the
  full-screen voice view with a "Calling…" banner that pops when the call ends
- IncomingCallOverlay banner (accept/decline) mounted app-wide, with a
  looping ringtone and a "Call declined" snackbar
- ringtone assets (incoming + outgoing ringback)

Tests: accordkit endpoint + gateway dispatch tests; CallState.copyWith unit
tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(voice): play caller ringback and stop "Calling…" leaking on hang-up

The outgoing-call ringback was dead code: `startRingtone(outgoing: true)`
and the bundled `ring_outgoing.wav` existed but nothing called them, so the
caller saw a "Calling…" spinner in silence while the callee heard a ringtone.
Wire the ringback in `startCall` and stop it the moment the call is answered,
declined, or cancelled.

Also fix a state leak: hitting the in-call "Disconnect" button while still
ringing routes through `VoiceController.leave()`, which never cleared
`CallController.outgoingChannelId` — so the "Calling…" state (and now the
ringback) leaked after a manual hang-up. A `build()` listener on the voice
channel clears the outgoing state and silences the ringback whenever the
ringing session ends by any path the explicit transitions don't cover.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(voice): address call controller bugs found in review

- acceptIncoming: return null when voice join fails, preventing the full-screen
  view from opening for a channel we aren't actually connected to
- startCall: set outgoingChannelId synchronously before the first await so
  concurrent taps (before the join completes) are blocked by hasOutgoing;
  also clear it on join failure or missing client
- cancelOutgoing: guard at top — no-ops when there is no outgoing call, so
  it cannot disconnect an unrelated voice session
- startCall / markAnswered / handleDecline / cancelOutgoing: wire the outgoing
  ringback tone (ring_outgoing.wav was added but never played)
- handleRing / handleDecline / handleCancelOrEnd / accept/declineIncoming:
  wrap fire-and-forget sound futures in unawaited() to make intent explicit
- test: add hasOutgoing group documenting the re-entrancy guard semantics

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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