kernel: dont replace last_blob with None

This commit is contained in:
hosted-fornet 2024-11-19 18:04:06 -08:00
parent bdf7fb171b
commit aed5758ed9
2 changed files with 24 additions and 9 deletions

View File

@ -99,7 +99,10 @@ impl process::ProcessState {
ref expects_response,
..
}) => {
self.last_blob = km.lazy_load_blob;
if km.lazy_load_blob.is_some() {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
}
km.lazy_load_blob = None;
if expects_response.is_some() || km.rsvp.is_some() {
// update prompting_message iff there is someone to reply to
@ -109,13 +112,19 @@ impl process::ProcessState {
}
t::Message::Response(_) => match self.contexts.remove(&km.id) {
Some((context, _timeout_handle)) => {
self.last_blob = km.lazy_load_blob;
if km.lazy_load_blob.is_some() {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
}
km.lazy_load_blob = None;
self.prompting_message = context.prompting_message;
(km, context.context)
}
None => {
self.last_blob = km.lazy_load_blob;
if km.lazy_load_blob.is_some() {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
}
km.lazy_load_blob = None;
self.prompting_message = Some(km.clone());
(km, None)

View File

@ -103,8 +103,10 @@ impl process::ProcessState {
ref expects_response,
..
}) => {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
if km.lazy_load_blob.is_some() {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
}
if expects_response.is_some() || km.rsvp.is_some() {
// update prompting_message iff there is someone to reply to
self.prompting_message = Some(km.clone());
@ -113,14 +115,18 @@ impl process::ProcessState {
}
t::Message::Response(_) => match self.contexts.remove(&km.id) {
Some((context, _timeout_handle)) => {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
if km.lazy_load_blob.is_some() {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
}
self.prompting_message = context.prompting_message;
(km, context.context)
}
None => {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
if km.lazy_load_blob.is_some() {
self.last_blob = km.lazy_load_blob;
km.lazy_load_blob = None;
}
self.prompting_message = Some(km.clone());
(km, None)
}