-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support adding middleware to every device mode destination #1053
Conversation
🦋 Changeset detectedLatest commit: 286fb8a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -878,6 +878,90 @@ describe('addDestinationMiddleware', () => { | |||
}) | |||
}) | |||
|
|||
it('drops events if next is never called', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These scenarios were not affected, but there didn't seem to be any explicit test coverage -- and they are relevant to what we're trying to do with consent. Anyway, threw those addition tests in -- since the docs don't even mention that you can call next with "null" to drop events.
@@ -226,7 +226,6 @@ export class LegacyDestination implements DestinationPlugin { | |||
type: 'Dropped by plan', | |||
}) | |||
) | |||
return ctx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok to remove because our event queue doesn't do anything with the returned ctx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( | ||
routing.length && | ||
routingMiddleware && | ||
plugin.type === 'destination' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool - so we were actually doing this check twice because addMiddleware
also checks this
Add
*
glob support.[x] I've included a changeset