#35531 [Bug]: In-memory spend transactions are lost when the database commit fails
### Summary
The default non-Redis spend update path drains its in-memory queues before committing them to the database. If the commit fails, the drained transactions are not restored, so spend updates disappear
### Current behavior
The default for `use_redis_transaction_buffer` is `False`
`_commit_spend_updates_to_db_without_redis_buffer()` first calls:
~~~python db_spend_update_transactions = await ( self.spend_update_queue .flush_and_get_aggregated_db_spend_update_transactions() ) await self._commit_spend_updates_to_db( db_spend_update_transactions=db_spend_update_transactions, ... ) ~~~
There is no `try/except` that restores the flushed batch when `_commit_spend_updates_to_db()` fails. The daily user, team, organization, end-user, and agent queues are flushed in the same method and are also not restored if their subsequent database update fails
### Reproduction
A focused unit test can inject one transaction and force the commit to fail:
~~~python queue = writer.spend_update_queue await queue.add_update(transaction)
with patch.object( writer, "_commit_spend_updates_to_db", new=AsyncMock(side_effect=RuntimeError("database unavailable")), ): …