Skip to content

.toJSON() sometimes doesn't convert values #207

@walshie4

Description

@walshie4

Environment details

  • OS: CoreOS
  • Node.js version: v8.9.4
  • npm version: v6.1.0
  • @google-cloud/spanner version: v1.4.1

Steps to reproduce

  1. Setup db with table which contains a field with a definition as follows:
fieldName ARRAY<STRING(32)>
  1. Query said table (I'm doing this in queries with a LIMIT 1000 on them), and call .toJSON() on each returned row
  2. Use some validation code like such to detect fields not being converted
if (arrayField && arrayField.length > 0 && arrayField.some(each => typeof each === 'object')) {
  console.log('Object in arrayField');
}

I've added the aforementioned logs to a task and API I suspected was being impacted by this issue and get rows which look like the following next to converted fields:

{
  fieldName: {
    kind: "stringValue",
    stringValue: "value",
  },
}

However a fair amount of requests are still succeeding so this issue does not appear to be constant.

Metadata

Metadata

Labels

🚨This issue needs some love.api: spannerIssues related to the googleapis/nodejs-spanner API.needs more infoThis issue needs more information from the customer to proceed.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions