-
Notifications
You must be signed in to change notification settings - Fork 9
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
Message rejection of asynchronous interceptors not reported back to the sender #147
Comments
mofogasy
added a commit
that referenced
this issue
Aug 19, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public async intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. await next.handle(message); } } ```
17 tasks
mofogasy
added a commit
that referenced
this issue
Aug 19, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public async intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. await next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Aug 19, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Aug 22, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Aug 22, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Sep 30, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. Note: The messaging protocol between host and client HAS NOT CHANGED. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Sep 30, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. Note: The messaging protocol between host and client HAS NOT CHANGED. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Sep 30, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. Note: The messaging protocol between host and client HAS NOT CHANGED. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Sep 30, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. Note: The messaging protocol between host and client HAS NOT CHANGED. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
mofogasy
added a commit
that referenced
this issue
Sep 30, 2022
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. Note: The messaging protocol between host and client HAS NOT CHANGED. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. return next.handle(message); } } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Messages and intents can be intercepted by registering an interceptor. The chain of interceptors can be continued synchronously or asynchronously. However, if an asynchronous interceptor is installed, errors are no longer reported back to the sender from the first asynchronous interceptor onwards.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Errors thrown by asynchronous interceptors or subsequent interceptors are reported back to the sender.
The text was updated successfully, but these errors were encountered: