From ebc6cce3c66ebae4d0671dae31182bed93d60fbd Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Thu, 30 Oct 2025 12:46:39 +0200 Subject: [PATCH 1/2] RDoc-3554 Deleting a non-existing compare-exchange item returns false --- .../content/_delete-cmpxchg-items-csharp.mdx | 14 ++++++++++---- .../content/_delete-cmpxchg-items-nodejs.mdx | 7 +++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx b/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx index f699229740..7747135fd5 100644 --- a/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx +++ b/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx @@ -262,8 +262,11 @@ import CodeBlock from '@theme/CodeBlock'; bool successful = resultOfDelete.Successful; // Has operation succeeded long indexOfItem = resultOfDelete.Index; // The version of the deleted item - // If 'successful' is true - the compare-exchange item was deleted. - // If 'successful' is false - the item was not deleted (index mismatch). + // If 'successful' is true - the compare-exchange item was deleted. + + // If 'successful' is false - + // * The item was not deleted because the index didn't match (it was modified by someone else), + // * Or the item no longer existed at the time of deletion (it was already deleted). } ``` @@ -287,8 +290,11 @@ import CodeBlock from '@theme/CodeBlock'; bool successful = resultOfDelete.Successful; // Has operation succeeded long indexOfItem = resultOfDelete.Index; // The version of the deleted item - // If 'successful' is true - the compare-exchange item was deleted. - // If 'successful' is false - the item was not deleted (index mismatch). + // If 'successful' is true - the compare-exchange item was deleted. + + // If 'successful' is false - + // * The item was not deleted because the index didn't match (it was modified by someone else), + // * Or the item no longer existed at the time of deletion (it was already deleted). } ``` diff --git a/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx b/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx index 98733ea1b6..56caf8a3b8 100644 --- a/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx +++ b/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx @@ -180,8 +180,11 @@ import CodeBlock from '@theme/CodeBlock'; const successful = resultOfDelete.successful; // Has operation succeeded const indexOfItem = resultOfDelete.index; // The version of the deleted item - // If 'successful' is true - the compare-exchange item was deleted. - // If 'successful' is false - the item was not deleted (index mismatch). + // If 'successful' is true - the compare-exchange item was deleted. + + // If 'successful' is false - + // * The item was not deleted because the index didn't match (it was modified by someone else), + // * Or the item no longer existed at the time of deletion (it was already deleted). } ``` From 268dac5606c7096548249b6ed62fbb55fba8fd0f Mon Sep 17 00:00:00 2001 From: Danielle9897 Date: Mon, 3 Nov 2025 17:23:45 +0200 Subject: [PATCH 2/2] RDoc-3554 fix text --- .../content/_delete-cmpxchg-items-csharp.mdx | 19 ++++++++++++------- .../content/_delete-cmpxchg-items-nodejs.mdx | 8 +++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx b/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx index 7747135fd5..eee16ab16b 100644 --- a/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx +++ b/docs/compare-exchange/content/_delete-cmpxchg-items-csharp.mdx @@ -262,11 +262,13 @@ import CodeBlock from '@theme/CodeBlock'; bool successful = resultOfDelete.Successful; // Has operation succeeded long indexOfItem = resultOfDelete.Index; // The version of the deleted item - // If 'successful' is true - the compare-exchange item was deleted. - + // If 'successful' is true - the compare-exchange item was deleted. + // If 'successful' is false - - // * The item was not deleted because the index didn't match (it was modified by someone else), + // * The item was not deleted because the index didn't match (it was modified by someone else). + // In this case, 'resultOfDelete.Value' will contain the current value stored on the server. // * Or the item no longer existed at the time of deletion (it was already deleted). + // In this case, 'resultOfDelete.Value' will be null. } ``` @@ -284,17 +286,20 @@ import CodeBlock from '@theme/CodeBlock'; itemToDelete.Key, itemToDelete.Index); // Execute the delete operation by passing it to Operations.SendAsync - CompareExchangeResult resultOfDelete = await store.Operations.SendAsync(deleteCmpXchgOp); + CompareExchangeResult resultOfDelete = await + store.Operations.SendAsync(deleteCmpXchgOp); // Check results bool successful = resultOfDelete.Successful; // Has operation succeeded long indexOfItem = resultOfDelete.Index; // The version of the deleted item - // If 'successful' is true - the compare-exchange item was deleted. - + // If 'successful' is true - the compare-exchange item was deleted. + // If 'successful' is false - - // * The item was not deleted because the index didn't match (it was modified by someone else), + // * The item was not deleted because the index didn't match (it was modified by someone else). + // In this case, 'resultOfDelete.Value' will contain the current value stored on the server. // * Or the item no longer existed at the time of deletion (it was already deleted). + // In this case, 'resultOfDelete.Value' will be null. } ``` diff --git a/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx b/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx index 56caf8a3b8..39bb9c6ff1 100644 --- a/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx +++ b/docs/compare-exchange/content/_delete-cmpxchg-items-nodejs.mdx @@ -180,11 +180,13 @@ import CodeBlock from '@theme/CodeBlock'; const successful = resultOfDelete.successful; // Has operation succeeded const indexOfItem = resultOfDelete.index; // The version of the deleted item - // If 'successful' is true - the compare-exchange item was deleted. - + // If 'successful' is true - the compare-exchange item was deleted. + // If 'successful' is false - - // * The item was not deleted because the index didn't match (it was modified by someone else), + // * The item was not deleted because the index didn't match (it was modified by someone else). + // In this case, 'resultOfDelete.value' will contain the current value stored on the server. // * Or the item no longer existed at the time of deletion (it was already deleted). + // In this case, 'resultOfDelete.value' will be null. } ```