Compare commits

..

2 Commits

Author SHA1 Message Date
dependabot[bot]
79f525cb97 chore(deps): bump taiki-e/install-action from 2.75.19 to 2.77.1
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.75.19 to 2.77.1.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](5f57d6cb7c...cca35edeb1)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.77.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 04:06:41 +00:00
link2xt
31c74d82bd fix: fix migration 152
It was converting OutFailed to OutDraft
instead of converting OutPreparing to OutFailed.
2026-05-11 20:53:00 +00:00
5 changed files with 20 additions and 14 deletions

View File

@@ -143,7 +143,7 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install nextest
uses: taiki-e/install-action@5f57d6cb7cd20b14a8a27f522884c4bc8a187458
uses: taiki-e/install-action@cca35edeb1d01366c2843b68fc3ca441446d73d3
with:
tool: nextest

View File

@@ -427,16 +427,18 @@ mod tests {
let self_chat = ctx1.get_self_chat().await;
let msgs = get_chat_msgs(&ctx1, self_chat.id).await.unwrap();
assert_eq!(msgs.len(), 2);
let ChatItem::Message { msg_id } = msgs.first().unwrap() else {
panic!("wrong chat item");
let msgid = match msgs.first().unwrap() {
ChatItem::Message { msg_id } => msg_id,
_ => panic!("wrong chat item"),
};
let msg = Message::load_from_db(&ctx1, *msg_id).await.unwrap();
let msg = Message::load_from_db(&ctx1, *msgid).await.unwrap();
let text = msg.get_text();
assert_eq!(text, "hi there");
let ChatItem::Message { msg_id } = msgs.get(1).unwrap() else {
panic!("wrong chat item");
let msgid = match msgs.get(1).unwrap() {
ChatItem::Message { msg_id } => msg_id,
_ => panic!("wrong chat item"),
};
let msg = Message::load_from_db(&ctx1, *msg_id).await.unwrap();
let msg = Message::load_from_db(&ctx1, *msgid).await.unwrap();
let path = msg.get_file(&ctx1).unwrap();
assert_eq!(

View File

@@ -704,10 +704,10 @@ async fn test_parse_ndn_group_msg() -> Result<()> {
assert_eq!(msg.state, MessageState::OutFailed);
let msgs = chat::get_chat_msgs(&t, msg.chat_id).await?;
assert!(matches!(
*msgs.last().unwrap(),
ChatItem::Message { msg_id } if msg_id == msg.id
));
let ChatItem::Message { msg_id } = *msgs.last().unwrap() else {
panic!("Wrong item type");
};
assert_eq!(msg_id, msg.id);
Ok(())
}
@@ -1598,7 +1598,9 @@ async fn test_in_reply_to() {
// Load the first message from the same chat.
let msgs = chat::get_chat_msgs(&t, msg.chat_id).await.unwrap();
let ChatItem::Message { msg_id } = msgs.first().unwrap() else {
let msg_id = if let ChatItem::Message { msg_id } = msgs.first().unwrap() {
msg_id
} else {
panic!("Wrong item type");
};

View File

@@ -2378,7 +2378,7 @@ ALTER TABLE contacts ADD COLUMN name_normalized TEXT;
sql.execute_migration(
"
UPDATE msgs SET state=26 WHERE state=28; -- Change OutMdnRcvd to OutDelivered.
UPDATE msgs SET state=19 WHERE state=24; -- Change OutPreparing to OutFailed.
UPDATE msgs SET state=24 WHERE state=18; -- Change OutPreparing to OutFailed.
",
migration_version,
)

View File

@@ -1557,7 +1557,9 @@ pub(crate) async fn get_chat_msg(
asserted_msgs_count,
msgs.len()
);
let ChatItem::Message { msg_id } = msgs[index] else {
let msg_id = if let ChatItem::Message { msg_id } = msgs[index] {
msg_id
} else {
panic!("Wrong item type");
};
Message::load_from_db(&t.ctx, msg_id).await.unwrap()