Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark PostTransactionAsync as deprecated since ArangoDB 3.12 #501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using ArangoDBNetStandard.Serialization;
using ArangoDBNetStandard.TransactionApi.Models;
using ArangoDBNetStandardTest.Serialization.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
Expand Down Expand Up @@ -184,7 +184,7 @@ public void Serialize_ShouldCamelCaseBindVars_WhenSerializingPostCursorBodyWithD
var serialization = new JsonNetApiClientSerialization();

byte[] jsonBytes = serialization.Serialize(body, new ApiClientSerializationOptions(
useCamelCasePropertyNames: true,
useCamelCasePropertyNames: true,
ignoreNullValues: true,
applySerializationOptionsToDictionaryValues: true));

Expand All @@ -197,6 +197,7 @@ public void Serialize_ShouldCamelCaseBindVars_WhenSerializingPostCursorBodyWithD
}

[Fact]
[Obsolete]
public void Serialize_ShouldNotCamelCaseParams_WhenSerializingPostTransactionBody()
{
var body = new PostTransactionBody
Expand All @@ -223,6 +224,7 @@ public void Serialize_ShouldNotCamelCaseParams_WhenSerializingPostTransactionBod


[Fact]
[Obsolete]
public void Serialize_ShouldCamelCaseParams_WhenSerializingPostTransactionBodyWithDictionaryOption()
{
var body = new PostTransactionBody
Expand Down Expand Up @@ -268,6 +270,7 @@ public void Serialize_ShouldNotIgnoreNull_WhenSerializingPostCursorBody()
}

[Fact]
[Obsolete]
public void Serialize_ShouldNotIgnoreNull_WhenSerializingPostTransactionBody()
{
var body = new PostTransactionBody
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ArangoDBNetStandard;
Expand Down Expand Up @@ -250,6 +251,7 @@ public async Task GetTransactionStatus_ShouldThrowException_WhenTheTransctionIdI
/// Tests that a post JS transaction succeeds.
/// </summary>
[Fact]
[Obsolete]
public async Task PostTransaction_ShouldSucceed()
{
await _adb.Document.PostDocumentAsync(
Expand Down Expand Up @@ -295,6 +297,7 @@ await _adb.Document.PostDocumentAsync(
/// </summary>
/// <exception cref="ApiErrorException">With ErrorNum 10 missing/invalid action definition for transaction.</exception>
[Fact]
[Obsolete]
public async Task PostTransaction_ShouldThrow_WhenFunctionDefinitionHasSyntaxErrors()
{
var ex = await Assert.ThrowsAsync<ApiErrorException>(async () =>
Expand All @@ -314,6 +317,7 @@ await _adb.Transaction.PostTransactionAsync<object>(new PostTransactionBody
/// </summary>
/// <exception cref="ApiErrorException">With ErrorNum 10 missing/invalid collections definition for transaction.</exception>
[Fact]
[Obsolete]
public async Task PostTransaction_ShouldThrow_WhenWriteCollectionIsNotDeclared()
{
var ex = await Assert.ThrowsAsync<ApiErrorException>(async () =>
Expand Down
10 changes: 8 additions & 2 deletions arangodb-net-standard/TransactionApi/ITransactionApiClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading;
using System;
using System.Threading;
using System.Threading.Tasks;
using ArangoDBNetStandard.TransactionApi.Models;

Expand Down Expand Up @@ -87,12 +88,17 @@ Task<StreamTransactionResponse> GetTransactionStatus(string transactionId,
CancellationToken token = default);

/// <summary>
/// POST a transaction to ArangoDB.
/// [DEPRECATED] POST a JavaScript Transaction to ArangoDB.
/// </summary>
/// <remarks>
/// JavaScript Transactions are deprecated from v3.12.0 onward and will be removed in a future version.
/// https://docs.arangodb.com/stable/release-notes/version-3.12/incompatible-changes-in-3-12/#javascript-transactions-deprecated
/// </remarks>
/// <typeparam name="T">Type to use for deserializing the object returned by the transaction function.</typeparam>
/// <param name="body">Object containing information to submit in the POST transaction request.</param>
/// <param name="token">A CancellationToken to observe while waiting for the task to complete or to cancel the task.</param>
/// <returns>Response from ArangoDB after processing the request.</returns>
[Obsolete("JavaScript Transactions are deprecated in ArangoDB 3.12, use Stream Transactions instead.")]
Task<PostTransactionResponse<T>> PostTransactionAsync<T>(PostTransactionBody body,
CancellationToken token = default);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;

namespace ArangoDBNetStandard.TransactionApi.Models
{
/// <summary>
/// Represents information required to make a transaction request to ArangoDB.
/// </summary>
[Obsolete]
public class PostTransactionBody
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public TransactionApiClient(IApiClientTransport client, IApiClientSerialization
/// <param name="body">Object containing information to submit in the POST transaction request.</param>
/// <param name="token">A CancellationToken to observe while waiting for the task to complete or to cancel the task.</param>
/// <returns>Response from ArangoDB after processing the request.</returns>
[Obsolete]
public virtual async Task<PostTransactionResponse<T>> PostTransactionAsync<T>(
PostTransactionBody body,
CancellationToken token = default)
Expand Down