[BUG] System.ArgumentException: Json2Mongo unexpected type
Summary
Occasionally, moving a token, updating the map or other activity doesn't result in a change.
This is caused by a server error in UpdateObject
Steps to reproduce
Unknown
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
Client Logs
HubConnection.js:409 Uncaught (in promise) Error: An unexpected error occurred invoking 'UpdateObject' on the server.
at e.callbacks.<computed> (HubConnection.js:409)
at t.processIncomingData (HubConnection.js:521)
at t.connection.onreceive (HubConnection.js:73)
at WebSocket.o.onmessage (WebSocketTransport.js:112)
Server Logs
System.ArgumentException: Json2Mongo unexpected type:
at MythicTable.Common.JsonPatch.JsonPatchTranslator.Json2Mongo(Object json) in /builds/mythicteam/mythictable/server/src/MythicTable/Common/JsonPatch/JsonPatchTranslator.cs:line 59
at MythicTable.Collections.Providers.MongoDbCollectionProvider.InternalUpdate(JsonPatchDocument patch, FilterDefinition`1 filter)
at MythicTable.Collections.Providers.MongoDbCollectionProvider.UpdateByCampaign(String collectionId, String campaignId, String id, JsonPatchDocument patch) in /builds/mythicteam/mythictable/server/src/MythicTable/Collections/Providers/MongoDbCollectionProvider.cs:line 151
at MythicTable.LivePlayHub.UpdateObject(String sessionId, UpdateCollectionHubParameters parameters) in /builds/mythicteam/mythictable/server/src/MythicTable/LivePlayHub.cs:line 122
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.ExecuteHubMethod(ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.<>c__DisplayClass13_0.<<Invoke>g__ExecuteInvocation|0>d.MoveNext()
Possible fixes
Improve Json2Mongo
to handle all types and to report on the failing type with more details
Cause (Fill out after fix)
Chose one or more:
-
Work was rushed -
Plan Incomplete -
Insufficient Tests -
Missed in Review