diff --git a/billing/lib/ucan-stream.js b/billing/lib/ucan-stream.js index 1618e19e..58871a41 100644 --- a/billing/lib/ucan-stream.js +++ b/billing/lib/ucan-stream.js @@ -99,6 +99,11 @@ export const storeSpaceUsageDeltas = async (deltas, ctx) => { spaceDiffs.push(...res.ok) } + if (spaceDiffs.length === 0) return { + ok: 'no space diffs to store', + error: undefined + } + return ctx.spaceDiffStore.batchPut(spaceDiffs) }