Skip to content

BUG: GetFeed of LogRecord fails in Geotab.Checkmate.ObjectModel package version 5.7.2103.1 #154

@IanKemp

Description

@IanKemp

The following NuGet package call:

            var now = DateTimeOffset.UtcNow;
            LogRecordSearch searchParams = new()
            {
                FromDate = now.AddHours(-1).DateTime,
                ToDate = now.DateTime,
            };

            var gps = await api.CallAsync<IEnumerable<LogRecord>>("GetFeed", typeof(LogRecord), new
            {
                search = searchParams,
            });

yields the following request:

{
    "id": 0,
    "method": "GetFeed",
    "params": {
        "credentials": {
            "database": "<redacted>",
            "sessionId": "<redacted>",
            "userName": "<redacted>"
        },
        "typeName": "Geotab.Checkmate.ObjectModel.LogRecord",
        "search": {
            "fromDate": "2021-10-11T14:36:12.680Z",
            "toDate": "2021-10-11T15:36:12.680Z",
            "observeActiveState": false
        }
    }
}

which results (via Fiddler) in the following response:

{
    "result": {
        "data": [
<records>
        ],
        "toVersion": "0000000003a7c824"
    },
    "jsonrpc": "2.0",
    "id": 0
}

but using the NuGet package, the following exception is raised:

System.Exception: Error getting json response. HttpStatusCode: OK

JsonException: The JSON value could not be converted to System.Collections.Generic.IEnumerable`1[Geotab.Checkmate.ObjectModel.LogRecord]. Path: $.result | LineNumber: 0 | BytePositionInLine: 11.

This essentially makes the package unusable for us at this time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions