From eeb46468aa96977edd7a3dd2e2c5b50133555a54 Mon Sep 17 00:00:00 2001 From: Finn Bear Date: Tue, 25 Apr 2023 15:58:50 -0700 Subject: [PATCH] Bugfix #1856 - ensure futures are evaluated in the course of Value::get. (#1867) --- lib/src/sql/value/get.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/sql/value/get.rs b/lib/src/sql/value/get.rs index 2083510e..2d0f1b57 100644 --- a/lib/src/sql/value/get.rs +++ b/lib/src/sql/value/get.rs @@ -34,7 +34,14 @@ impl Value { // No further embedded fields, so just return this 0 => Ok(Value::Future(v.clone())), // Process the future and fetch the embedded field - _ => v.compute(ctx, opt, txn, None).await?.get(ctx, opt, txn, path).await, + _ => { + // Ensure the future is processed + let fut = &opt.futures(true); + // Get the future return value + let val = v.compute(ctx, fut, txn, None).await?; + // Fetch the embedded field + val.get(ctx, opt, txn, path).await + } } } // Current path part is an object