[CSHARP-2918] Watch method should work even when documents contain duplicate element names Created: 28/Jan/20 Updated: 28/Oct/23 Resolved: 06/Apr/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 2.9.1 |
| Fix Version/s: | 2.10.3, 2.11.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jessica Wyatt | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Description |
|
When calling MoveNext() on an IAsyncCursor<ChangeStreamDocument<T>> where the next change in the oplog is for a document that contains a duplicate element MoveNext() throws an InvalidOperationException with the message, "Duplicate element name '<ElementName>'." I can find no way to extract the ID of the document that caused this exception to occur from the change stream and no way to easily find documents with duplicate elements by any other means. Obviously you're not meant to have duplicate elements and we certainly try and keep them out of our data but on the odd occasion that it does slip in it is nearly impossible to find and it cripples our use of the change streams because there's no way to get the document ID or skip over the offending document. |
| Comments |
| Comment by Githook User [ 06/Apr/20 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Githook User [ 06/Apr/20 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Githook User [ 27/Mar/20 ] |
|
Author: {'email': 'robert@robertstam.org', 'name': 'rstam', 'username': 'rstam'}Message: |
| Comment by Githook User [ 12/Mar/20 ] |
|
Author: {'name': 'rstam', 'username': 'rstam', 'email': 'robert@robertstam.org'}Message: |
| Comment by Robert Stam [ 04/Mar/20 ] |
|
Thank you for reporting this. I am able to reproduce it with a small test program. I will be changing the driver so that the Watch method works even when documents contain duplicate element names. |
| Comment by Jessica Wyatt [ 26/Feb/20 ] |
|
Apologies for the long delay; it's been a busy few weeks. Here is the requested stack trace: System.InvalidOperationException: |
| Comment by Jessica Wyatt [ 03/Feb/20 ] |
|
Hi Esha, Thanks for looking into this. I will be able to send a stack trace but unfortunately it'll be a few weeks until I can as my manager has moved me onto something else for the time being and I'd need to create a minimal reproducible example as my employer isn't happy with me uploading a stack trace from our actual code base. |
| Comment by Esha Bhargava [ 03/Feb/20 ] |
|
chris.wyatt@livinglens.tvCan you send us a stack trace? |