Use transaction.oncomplete instead of request.success for write transactions.