fix: preserve Console Notify ACK identity and request ID limits
This commit is contained in:
@@ -546,6 +546,7 @@ fn durable_parent_notification_target<St: Store + Clone + Send + Sync + 'static>
|
||||
) -> crate::spawn::tool::ParentNotificationTarget {
|
||||
crate::spawn::tool::ParentNotificationTarget::Durable(Arc::new(move |method| {
|
||||
let Method::NotifyTracked {
|
||||
receipt_scope,
|
||||
notification_request_id,
|
||||
message,
|
||||
source,
|
||||
@@ -554,6 +555,7 @@ fn durable_parent_notification_target<St: Store + Clone + Send + Sync + 'static>
|
||||
return;
|
||||
};
|
||||
let (source_namespace, provenance) = resolved_input_source(&pending_submissions, &source);
|
||||
let source_namespace = receipt_scope.namespace(source_namespace);
|
||||
match pending_submissions.accept_notification_from_source(
|
||||
notification_request_id,
|
||||
message,
|
||||
@@ -2268,12 +2270,14 @@ where
|
||||
None
|
||||
}
|
||||
Method::NotifyTracked {
|
||||
receipt_scope,
|
||||
notification_request_id,
|
||||
message,
|
||||
source,
|
||||
} => {
|
||||
let (source_namespace, provenance) =
|
||||
resolved_input_source(pending_submissions, &source);
|
||||
let source_namespace = receipt_scope.namespace(source_namespace);
|
||||
durably_accept_notification(
|
||||
notification_request_id,
|
||||
message,
|
||||
@@ -2749,12 +2753,14 @@ async fn controller_loop<C, St>(
|
||||
}
|
||||
|
||||
Method::NotifyTracked {
|
||||
receipt_scope,
|
||||
notification_request_id,
|
||||
message,
|
||||
source,
|
||||
} => {
|
||||
let (source_namespace, provenance) =
|
||||
resolved_input_source(&pending_submissions, &source);
|
||||
let source_namespace = receipt_scope.namespace(source_namespace);
|
||||
durably_accept_notification(
|
||||
notification_request_id,
|
||||
message,
|
||||
@@ -3671,12 +3677,14 @@ where
|
||||
});
|
||||
}
|
||||
Some(Method::NotifyTracked {
|
||||
receipt_scope,
|
||||
notification_request_id,
|
||||
message,
|
||||
source,
|
||||
}) => {
|
||||
let (source_namespace, provenance) =
|
||||
resolved_input_source(pending_submissions, &source);
|
||||
let source_namespace = receipt_scope.namespace(source_namespace);
|
||||
if durably_accept_notification(
|
||||
notification_request_id,
|
||||
message,
|
||||
@@ -4824,6 +4832,7 @@ mod tests {
|
||||
let pending = PendingSubmissionHandle::for_test(dir.path());
|
||||
let (event_tx, mut event_rx) = broadcast::channel(4);
|
||||
let method = Method::NotifyTracked {
|
||||
receipt_scope: protocol::NotificationReceiptScope::Source,
|
||||
notification_request_id: "completion-1".into(),
|
||||
message: "subworker completed".into(),
|
||||
source: protocol::AuthenticatedInputSource::UntrustedWire,
|
||||
|
||||
@@ -272,6 +272,7 @@ impl ParentNotificationTarget {
|
||||
|
||||
pub(crate) fn notify(&self, child_session_id: String, message: String) {
|
||||
let method = Method::NotifyTracked {
|
||||
receipt_scope: protocol::NotificationReceiptScope::Source,
|
||||
notification_request_id: protocol::new_submission_request_id(),
|
||||
message,
|
||||
source: protocol::AuthenticatedInputSource::SubWorker {
|
||||
|
||||
@@ -1935,6 +1935,7 @@ async fn manual_compact_cancel_clears_progress_before_returning_idle() {
|
||||
let completion_request_id = "subworker-completion-during-compact";
|
||||
handle
|
||||
.send(Method::NotifyTracked {
|
||||
receipt_scope: protocol::NotificationReceiptScope::Source,
|
||||
notification_request_id: completion_request_id.into(),
|
||||
message: "subworker completed".into(),
|
||||
source: protocol::AuthenticatedInputSource::UntrustedWire,
|
||||
|
||||
@@ -601,6 +601,7 @@ fn notify_rejects_typed_side_effect_message_payloads() {
|
||||
message: "/prepare(first)".into(),
|
||||
},
|
||||
protocol::Method::NotifyTracked {
|
||||
receipt_scope: protocol::NotificationReceiptScope::Source,
|
||||
notification_request_id: "n-1".into(),
|
||||
message: "/prepare(first)".into(),
|
||||
source: protocol::AuthenticatedInputSource::UntrustedWire,
|
||||
|
||||
Reference in New Issue
Block a user