feat: content management changes (#6104)

* feat: change modpack updating flow

* fix: pending install state loss

* fix: mods.vue perf problems

* chore: todo doc

* draft: try preload/fix suspense

* fix: lint
This commit is contained in:
Calum H.
2026-05-20 17:07:35 +00:00
committed by GitHub
parent 079a10bba9
commit c3fe7b4232
19 changed files with 1111 additions and 277 deletions
+18 -12
View File
@@ -875,6 +875,7 @@ impl CachedEntry {
.fetch_all(pool)
.await?;
let now = Utc::now().timestamp();
for row in query {
let parsed_data = if let Some(data) = row.data.clone() {
Some(Self::deserialize_cache_value(type_, data, &row.id)?)
@@ -882,7 +883,7 @@ impl CachedEntry {
None
};
if row.expires <= Utc::now().timestamp() {
if row.expires <= now {
if cache_behaviour == CacheBehaviour::MustRevalidate {
continue;
} else {
@@ -890,6 +891,19 @@ impl CachedEntry {
}
}
let row_id = row.id.clone();
let row_alias = row.alias.clone();
let remove_matching_key = |x: &&str| {
x != &&*row_id
&& !row_alias.as_ref().is_some_and(|y| {
if type_.case_sensitive_alias().unwrap_or(true) {
x == y
} else {
y.to_lowercase() == x.to_lowercase()
}
})
};
if let Some(data) = parsed_data {
if data.get_type() != type_ {
return Err(crate::ErrorKind::OtherError(format!(
@@ -901,17 +915,7 @@ impl CachedEntry {
.as_error());
}
remaining_keys.retain(|x| {
x != &&*row.id
&& !row.alias.as_ref().is_some_and(|y| {
if type_.case_sensitive_alias().unwrap_or(true)
{
x == y
} else {
y.to_lowercase() == x.to_lowercase()
}
})
});
remaining_keys.retain(remove_matching_key);
return_vals.push(Self {
id: row.id,
@@ -920,6 +924,8 @@ impl CachedEntry {
data: Some(data),
expires: row.expires,
});
} else {
remaining_keys.retain(remove_matching_key);
}
}
}