Skip to content

Commit e5fda95

Browse files
authored
Fixed bug where ChangeFeed couldn't handle BlobChangeFeedEvent.EventD… (Azure#17770)
1 parent ddfbd20 commit e5fda95

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Release History
22

33
## 12.0.0-preview.8 (Unreleased)
4-
4+
- Fixed bug where we couldn't handle BlobChangeFeedEvent.EventData.ClientRequestIds that were not GUIDs.
55

66
## 12.0.0-preview.7 (2020-12-07)
77
- Added support for service version 2020-04-08.

sdk/storage/Azure.Storage.Blobs.ChangeFeed/api/Azure.Storage.Blobs.ChangeFeed.netstandard2.0.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public partial class BlobChangeFeedEventData
3333
internal BlobChangeFeedEventData() { }
3434
public Azure.Storage.Blobs.ChangeFeed.BlobOperationName BlobOperationName { get { throw null; } }
3535
public Azure.Storage.Blobs.Models.BlobType BlobType { get { throw null; } }
36-
public System.Guid ClientRequestId { get { throw null; } }
36+
public string ClientRequestId { get { throw null; } }
3737
public long ContentLength { get { throw null; } }
3838
public long? ContentOffset { get { throw null; } }
3939
public string ContentType { get { throw null; } }
@@ -76,7 +76,7 @@ public static partial class BlobChangeFeedExtensions
7676
public static partial class BlobChangeFeedModelFactory
7777
{
7878
public static Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedEvent BlobChangeFeedEvent(string topic, string subject, Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedEventType eventType, System.DateTimeOffset eventTime, System.Guid id, Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedEventData eventData, long dataVersion, string metadataVersion) { throw null; }
79-
public static Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedEventData BlobChangeFeedEventData(string api, System.Guid clientRequestId, System.Guid requestId, Azure.ETag eTag, string contentType, long contentLength, Azure.Storage.Blobs.Models.BlobType blobType, long contentOffset, System.Uri destinationUri, System.Uri sourceUri, System.Uri uri, bool recursive, string sequencer) { throw null; }
79+
public static Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedEventData BlobChangeFeedEventData(string api, string clientRequestId, System.Guid requestId, Azure.ETag eTag, string contentType, long contentLength, Azure.Storage.Blobs.Models.BlobType blobType, long contentOffset, System.Uri destinationUri, System.Uri sourceUri, System.Uri uri, bool recursive, string sequencer) { throw null; }
8080
}
8181
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
8282
public readonly partial struct BlobOperationName : System.IEquatable<Azure.Storage.Blobs.ChangeFeed.BlobOperationName>

sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobChangeFeedEventData.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.ComponentModel;
67
using Azure.Storage.Blobs.Models;
78

89
namespace Azure.Storage.Blobs.ChangeFeed
@@ -20,7 +21,7 @@ internal BlobChangeFeedEventData() { }
2021
internal BlobChangeFeedEventData(Dictionary<string, object> record)
2122
{
2223
BlobOperationName = new BlobOperationName((string)record[Constants.ChangeFeed.EventData.Api]);
23-
ClientRequestId = Guid.Parse((string)record[Constants.ChangeFeed.EventData.ClientRequestId]);
24+
ClientRequestId = (string)record[Constants.ChangeFeed.EventData.ClientRequestId];
2425
RequestId = Guid.Parse((string)record[Constants.ChangeFeed.EventData.RequestId]);
2526
ETag = new ETag((string)record[Constants.ChangeFeed.EventData.Etag]);
2627
ContentType = (string)record[Constants.ChangeFeed.EventData.ContentType];
@@ -55,7 +56,7 @@ internal BlobChangeFeedEventData(Dictionary<string, object> record)
5556
/// diagnostic logs using the "client-request-id" field in the logs, and can be provided in client requests using
5657
/// the "x-ms-client-request-id" header.
5758
/// </summary>
58-
public Guid ClientRequestId { get; internal set; }
59+
public string ClientRequestId { get; internal set; }
5960

6061
/// <summary>
6162
/// Service-generated request id for the storage API operation. Can be used to correlate to Azure Storage diagnostic

sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobChangeFeedModelFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static BlobChangeFeedEvent BlobChangeFeedEvent(
4040
/// </summary>
4141
public static BlobChangeFeedEventData BlobChangeFeedEventData(
4242
string api,
43-
Guid clientRequestId,
43+
string clientRequestId,
4444
Guid requestId,
4545
ETag eTag,
4646
string contentType,

sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChunkTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public async Task Next()
137137
string metadataVersion = "1";
138138

139139
string api = "PutBlob";
140-
Guid clientRequestId = Guid.NewGuid();
140+
string clientRequestId = $"Azure-Storage-Powershell-{Guid.NewGuid()}";
141141
Guid requestId = Guid.NewGuid();
142142
ETag etag = new ETag("0x8D75EF45A3B8617");
143143
string contentType = "contentType";

0 commit comments

Comments
 (0)