Skip to content

Refactor: extract helpers to reduce handler complexity#143

Merged
mattn merged 3 commits into
masterfrom
refactor-cleanup
Apr 8, 2026
Merged

Refactor: extract helpers to reduce handler complexity#143
mattn merged 3 commits into
masterfrom
refactor-cleanup

Conversation

@mattn

@mattn mattn commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Extract duplicated filter authorization checks into validateFilterAccess and event persistence logic into saveEvent to break up oversized handler functions. Also switch the listener mutex to sync.RWMutex and release it before writing to WebSockets to reduce lock contention.

Note: ReplaceEvent errors were previously silently ignored via RelayWrapper.Publish; they now propagate as OK false to the client. This is an intentional behavior change.

@mattn mattn merged commit c63d550 into master Apr 8, 2026
1 check passed
@mattn mattn deleted the refactor-cleanup branch April 8, 2026 14:04
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