Skip to content

Fix/mirror limits optional chaining#568

Open
tharu-jwd wants to merge 2 commits intocameri:mainfrom
tharu-jwd:fix/mirror-limits-optional-chaining
Open

Fix/mirror limits optional chaining#568
tharu-jwd wants to merge 2 commits intocameri:mainfrom
tharu-jwd:fix/mirror-limits-optional-chaining

Conversation

@tharu-jwd
Copy link
Copy Markdown

Description

Add optional chaining to this.config.limits?.event in StaticMirroringWorker.canAcceptEvent()

Related Issue

Fixes #567

Motivation and Context

Mirror.limits is typed as optional but was accessed without optional chaining. When a mirror entry has no limits block configured, this throws a TypeError inside the message handler which gets swallowed by the surrounding try/catch. So the mirror connects and subscribes fine, but silently drops every incoming event.

How Has This Been Tested?

Manually configured a mirror entry without a limits block and confirmed events are stored correctly after the fix.

Screenshots (if appropriate):

N/A

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

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.

[BUG] Static mirroring silently drops all events when mirror has no limits configured

1 participant