fix: only add delta bytes when changing app data value

This commit is contained in:
trisua 2025-07-20 03:33:03 -04:00
parent 270d7550d6
commit d58e47cbbe
2 changed files with 9 additions and 2 deletions

View file

@ -160,7 +160,14 @@ pub async fn update_value_request(
}
// ...
if let Err(e) = data.add_app_data_used(app.id, req.value.len() as i32).await {
// we only need to add the delta size (the next size - the old size)
if let Err(e) = data
.add_app_data_used(
app.id,
(req.value.len() as i32) - (app_data.value.len() as i32),
)
.await
{
return Json(e.into());
}