huskies: merge 891
This commit is contained in:
@@ -56,7 +56,7 @@ fn unblock_by_story_id(story_id: &str) -> String {
|
||||
let crdt_item = crate::crdt_state::read_item(story_id);
|
||||
let story_name = crdt_item
|
||||
.as_ref()
|
||||
.and_then(|i| i.name.clone())
|
||||
.and_then(|i| i.name().map(str::to_string))
|
||||
.unwrap_or_else(|| story_id.to_string());
|
||||
|
||||
// Canonical "is this story blocked?" comes from the typed pipeline state.
|
||||
@@ -69,7 +69,7 @@ fn unblock_by_story_id(story_id: &str) -> String {
|
||||
Some(crate::pipeline_state::Stage::MergeFailure { .. })
|
||||
);
|
||||
// CRDT register fallback for items not yet projected into typed state.
|
||||
let crdt_blocked = crdt_item.as_ref().and_then(|i| i.blocked).unwrap_or(false);
|
||||
let crdt_blocked = crdt_item.as_ref().is_some_and(|i| i.blocked());
|
||||
|
||||
if !typed_blocked && !crdt_blocked {
|
||||
return format!("**{story_name}** ({story_id}) is not blocked. Nothing to unblock.");
|
||||
@@ -271,8 +271,8 @@ mod tests {
|
||||
let item = crate::crdt_state::read_item("9903_story_stuck")
|
||||
.expect("story should be in CRDT after unblock");
|
||||
assert_eq!(
|
||||
item.retry_count,
|
||||
Some(0),
|
||||
item.retry_count(),
|
||||
0,
|
||||
"retry_count should be reset to 0 in CRDT after unblock"
|
||||
);
|
||||
}
|
||||
@@ -334,14 +334,13 @@ mod tests {
|
||||
let item = crate::crdt_state::read_item(story_id)
|
||||
.expect("story should still be in CRDT after unblock");
|
||||
assert_eq!(
|
||||
item.retry_count,
|
||||
Some(0),
|
||||
item.retry_count(),
|
||||
0,
|
||||
"retry_count must be reset to 0 in CRDT after unblock"
|
||||
);
|
||||
assert!(
|
||||
!item.blocked.unwrap_or(false),
|
||||
"blocked flag must be cleared in CRDT after unblock: {:?}",
|
||||
item.blocked
|
||||
!item.blocked(),
|
||||
"blocked flag must be cleared in CRDT after unblock"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user