Skip to content

fix(protocol): guard connection state access#7461

Open
buyua9 wants to merge 1 commit into
status-im:developfrom
buyua9:fix/connection-state-race-buyua9
Open

fix(protocol): guard connection state access#7461
buyua9 wants to merge 1 commit into
status-im:developfrom
buyua9:fix/connection-state-race-buyua9

Conversation

@buyua9

@buyua9 buyua9 commented May 22, 2026

Copy link
Copy Markdown

Summary

  • protect Messenger.connectionState with a small RW mutex and route mailserver sync gating through accessor helpers
  • protect messaging.Core.connectionState while preserving the offline/online reliability transition behavior
  • add a focused concurrent accessor regression for the messenger connection-state helpers

Follow-up to #7350, which restored the mobile ConnectionChange propagation chain.

Why

ConnectionChanged can run while mailserver sync checks read the current connection state to decide whether expensive networks should be allowed. The restored state cache was read and written directly, which leaves the new connection-state path race-prone under concurrent network changes and store-node sync checks.

Validation

  • git diff --check origin/develop...HEAD
  • changed-file conflict marker scan: no matches in this PR's changed files
  • go test not run locally because this environment does not have the Go toolchain installed (go: command not found)

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