Skip to content

test: reproduce pre-ack QSS auth sync loss (#3376) - #3377

Draft
holmesworcester wants to merge 1 commit into
developfrom
agent/reproduce-qss-auth-sync-race-3376
Draft

test: reproduce pre-ack QSS auth sync loss (#3376)#3377
holmesworcester wants to merge 1 commit into
developfrom
agent/reproduce-qss-auth-sync-race-3376

Conversation

@holmesworcester

Copy link
Copy Markdown
Collaborator

What

  • Adds a focused regression test for iOS app gets stuck after receiving a push notification #3376.
  • Models the first AUTH_SYNC frame arriving before the per-community QSSAuthConnection is initialized.
  • Leaves the test intentionally failing so the diagnosis is pinned down before a production fix is proposed.

Diagnosis

On notification-driven iOS startup, QSS can emit its first AUTH_SYNC frame before SIGN_IN_COMMUNITY is acknowledged. QSSService starts the auth connection only after that acknowledgement. Meanwhile, QSSAuthConnectionManager handles the early frame, finds no active connection, logs an error, and discards it without queuing or replaying it. The auth handshake then continues without its first frame; the attached issue logs subsequently show DEVICE_UNKNOWN and a QSS disconnect.

The issue logs capture this exact ordering:

  • 16:25:20.807: client sends SIGN_IN_COMMUNITY
  • 16:25:20.950: first auth frame is rejected because the auth connection “wasn't initialized”
  • 16:25:20.952: auth connection is initialized
  • 16:25:22.037: server returns DEVICE_UNKNOWN, then QSS disconnects

Test

NODE_OPTIONS='--experimental-vm-modules' ./node_modules/.bin/jest \
  --runInBand \
  --runTestsByPath src/nest/qss/qss-auth-conn-manager.service.spec.ts \
  -t 'preserves the first auth sync frame' \
  --silent --forceExit

Expected red result proving the dropped frame:

Expected: [1, 2, 3, 4]
Number of calls: 0

Prettier, ESLint, and git diff --check pass. This PR contains no production fix.

Add a focused red regression test showing that an AUTH_SYNC frame received before auth connection initialization is discarded.
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