Skip to content

Commit d5e19a7

Browse files
committed
Ungate procedures from the unstable feature
Procedures (and the outgoing HTTP client used from procedures) are no longer gated behind the `unstable` feature / `SPACETIMEDB_UNSTABLE_FEATURES` across the module libraries. HTTP handlers/webhooks, views, RLS, and immediate-scheduling remain gated. - bindings-sys: ungate the `procedure` host-call module + raw ABI (start/commit/abort_mut_tx, procedure_http_request) and `call_no_ret`. - bindings (Rust): ungate the `procedure` macro, ProcedureContext, TxContext/with_tx/try_with_tx, db_read_only/get_read_only, procedure traits, register_procedure, __call_procedure__, procedure RNG, and the outgoing HttpClient. Add fine-grained gating inside http.rs so the HttpClient is exposed while HandlerContext/Router/handler macros stay gated. - bindings-csharp: drop [Experimental("STDB_UNSTABLE")] from ProcedureContext WithTx/TryWithTx (runtime + generated) and the generated ProcedureTxContext; regenerate FFI snapshots. - bindings-cpp: ungate the procedure ABI, tx_execution, the outgoing HTTP client (http.h/http_convert.h), and procedure_context.h; handlers keep requiring SPACETIMEDB_UNSTABLE_FEATURES. - docs: remove the procedures beta notices (HTTP handlers stay beta); regenerate static/llms.md. - sdk-test-procedure: no longer needs features = ["unstable"].
1 parent c70d002 commit d5e19a7

24 files changed

Lines changed: 69 additions & 133 deletions

File tree

crates/bindings-cpp/include/spacetimedb/abi/FFI.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,9 @@ using ::identity;
7575
using ::get_jwt;
7676

7777
// ===== Procedure Transactions =====
78-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
7978
using ::procedure_start_mut_tx;
8079
using ::procedure_commit_mut_tx;
8180
using ::procedure_abort_mut_tx;
82-
#endif
8381

8482
// ===== Module Export Helpers =====
8583

crates/bindings-cpp/include/spacetimedb/abi/abi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ STDB_IMPORT_10_2(get_jwt)
174174
Status get_jwt(const uint8_t* connection_id_ptr, BytesSource* out);
175175

176176
// ===== Procedure Transactions (spacetime_10.3) =====
177-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
178177
STDB_IMPORT_10_3(procedure_start_mut_tx)
179178
Status procedure_start_mut_tx(int64_t* out);
180179

@@ -190,7 +189,6 @@ Status procedure_http_request(
190189
const uint8_t* request_ptr, size_t request_len,
191190
const uint8_t* body_ptr, size_t body_len,
192191
BytesSource out[2]);
193-
#endif
194192

195193
} // extern "C"
196194

crates/bindings-cpp/include/spacetimedb/http.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
#pragma once
55

6-
#ifndef SPACETIMEDB_UNSTABLE_FEATURES
7-
#error "spacetimedb/http.h requires SPACETIMEDB_UNSTABLE_FEATURES to be enabled"
8-
#endif
9-
106
#include <string>
117
#include <vector>
128
#include <optional>
@@ -302,12 +298,8 @@ class HttpClient {
302298
* @endcode
303299
*/
304300
Outcome<HttpResponse> send(const HttpRequest& request) {
305-
#ifndef SPACETIMEDB_UNSTABLE_FEATURES
306-
return Err<HttpResponse>("HTTP requests require SPACETIMEDB_UNSTABLE_FEATURES to be enabled");
307-
#else
308301
// Implemented in http_client_impl.h to avoid circular dependencies
309302
return SendImpl(request);
310-
#endif
311303
}
312304

313305
private:
@@ -317,7 +309,7 @@ class HttpClient {
317309
} // namespace SpacetimeDB
318310

319311
// Include implementation dependencies after class definition to avoid circular dependencies
320-
#if defined(SPACETIMEDB_UNSTABLE_FEATURES) && !defined(SPACETIMEDB_HTTP_CONVERT_H)
312+
#ifndef SPACETIMEDB_HTTP_CONVERT_H
321313
#include "spacetimedb/logger.h"
322314
#include "spacetimedb/http_convert.h"
323315
#include "spacetimedb/http_client_impl.h"

crates/bindings-cpp/include/spacetimedb/http_convert.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,7 @@ inline std::pair<wire::HttpResponse, std::vector<uint8_t>> to_wire_split(const H
281281
} // namespace convert
282282
} // namespace SpacetimeDB
283283

284-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
285284
#include "spacetimedb/logger.h"
286285
#include "spacetimedb/http_client_impl.h"
287-
#endif
288286

289287
#endif // SPACETIMEDB_HTTP_CONVERT_H

crates/bindings-cpp/include/spacetimedb/internal/tx_execution.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
namespace SpacetimeDB::Internal {
1111

12-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
13-
1412
template<typename T>
1513
struct is_outcome : std::false_type {};
1614

@@ -143,8 +141,6 @@ auto try_with_tx(MakeReducerContext&& make_reducer_ctx, Func& body) -> decltype(
143141
return result;
144142
}
145143

146-
#endif
147-
148144
} // namespace SpacetimeDB::Internal
149145

150146
#endif // SPACETIMEDB_INTERNAL_TX_EXECUTION_H

crates/bindings-cpp/include/spacetimedb/procedure_context.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
#include <spacetimedb/abi/FFI.h> // For transaction syscalls
99
#include <spacetimedb/internal/tx_execution.h>
1010
#include <spacetimedb/random.h> // For StdbRng
11-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
1211
#include <spacetimedb/http.h> // For HttpClient
13-
#endif
1412
#include <cstdint>
1513
#include <functional>
1614
#include <stdexcept>
@@ -66,12 +64,10 @@ struct ProcedureContext {
6664
// Used to track which client connection initiated this procedure
6765
ConnectionId connection_id;
6866

69-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
7067
// HTTP client for making external requests
7168
// IMPORTANT: HTTP calls are NOT allowed inside transactions!
7269
// Always call HTTP before with_tx() or try_with_tx()
7370
HttpClient http;
74-
#endif
7571

7672
private:
7773
// Lazily initialized RNG for UUID generation
@@ -173,10 +169,9 @@ struct ProcedureContext {
173169
return Uuid::from_counter_v7(counter_uuid_, timestamp, random_bytes);
174170
}
175171

176-
#ifdef SPACETIMEDB_UNSTABLE_FEATURES
177172
/**
178173
* @brief Execute a callback within a database transaction
179-
*
174+
*
180175
* Starts a mutable transaction, executes the callback, and commits on success.
181176
* If the callback panics (via LOG_PANIC), the transaction is automatically rolled back.
182177
*
@@ -238,7 +233,6 @@ struct ProcedureContext {
238233
};
239234
return Internal::try_with_tx(make_reducer_ctx, body);
240235
}
241-
#endif
242236
};
243237

244238
} // namespace SpacetimeDB

crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bindings-csharp/Codegen.Tests/fixtures/explicitnames/snapshots/Module#FFI.verified.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,11 @@ Internal.TxContext inner
151151

152152
private ProcedureTxContext? _cached;
153153

154-
[Experimental("STDB_UNSTABLE")]
155154
public Local Db => _db;
156155

157-
[Experimental("STDB_UNSTABLE")]
158156
public TResult WithTx<TResult>(Func<ProcedureTxContext, TResult> body) =>
159157
base.WithTx(tx => body((ProcedureTxContext)tx));
160158

161-
[Experimental("STDB_UNSTABLE")]
162159
public TxOutcome<TResult> TryWithTx<TResult, TError>(
163160
Func<ProcedureTxContext, Result<TResult, TError>> body
164161
)
@@ -252,7 +249,6 @@ public Uuid NewUuidV7()
252249
}
253250
}
254251

255-
[Experimental("STDB_UNSTABLE")]
256252
public sealed class ProcedureTxContext : global::SpacetimeDB.ProcedureTxContextBase
257253
{
258254
internal ProcedureTxContext(Internal.TxContext inner)

crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,14 +593,11 @@ Internal.TxContext inner
593593

594594
private ProcedureTxContext? _cached;
595595

596-
[Experimental("STDB_UNSTABLE")]
597596
public Local Db => _db;
598597

599-
[Experimental("STDB_UNSTABLE")]
600598
public TResult WithTx<TResult>(Func<ProcedureTxContext, TResult> body) =>
601599
base.WithTx(tx => body((ProcedureTxContext)tx));
602600

603-
[Experimental("STDB_UNSTABLE")]
604601
public TxOutcome<TResult> TryWithTx<TResult, TError>(
605602
Func<ProcedureTxContext, Result<TResult, TError>> body
606603
)
@@ -694,7 +691,6 @@ public Uuid NewUuidV7()
694691
}
695692
}
696693

697-
[Experimental("STDB_UNSTABLE")]
698694
public sealed class ProcedureTxContext : global::SpacetimeDB.ProcedureTxContextBase
699695
{
700696
internal ProcedureTxContext(Internal.TxContext inner)

crates/bindings-csharp/Codegen/Module.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,14 +2545,11 @@ internal ProcedureContext(Identity identity, ConnectionId? connectionId, Random
25452545
25462546
private ProcedureTxContext? _cached;
25472547
2548-
[Experimental("STDB_UNSTABLE")]
25492548
public Local Db => _db;
2550-
2551-
[Experimental("STDB_UNSTABLE")]
2549+
25522550
public TResult WithTx<TResult>(Func<ProcedureTxContext, TResult> body) =>
25532551
base.WithTx(tx => body((ProcedureTxContext)tx));
2554-
2555-
[Experimental("STDB_UNSTABLE")]
2552+
25562553
public TxOutcome<TResult> TryWithTx<TResult, TError>(
25572554
Func<ProcedureTxContext, Result<TResult, TError>> body)
25582555
where TError : Exception =>
@@ -2643,7 +2640,6 @@ public Uuid NewUuidV7()
26432640
}
26442641
}
26452642
2646-
[Experimental("STDB_UNSTABLE")]
26472643
public sealed class ProcedureTxContext : global::SpacetimeDB.ProcedureTxContextBase {
26482644
internal ProcedureTxContext(Internal.TxContext inner) : base(inner) {}
26492645

0 commit comments

Comments
 (0)