RealDevSquad / RealDevSquad/website-backend

Creating task fails

Open
#344 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

2021-04-26T04:23:39.937466+00:00 app[web.1]: {"level":"error","message":"Error in creating task Value for argument \"data\" is not a valid Firestore document. Cannot use \"undefined\" as a Firestore value (found in field \"assignee\"). If you want to ignore undefined values, enable `ignoreUndefinedProperties`.","stack":"Error: Value for argument \"data\" is not a valid Firestore document. Cannot use \"undefined\" as a Firestore value (found in field \"assignee\"). If you want to ignore undefined values, enable `ignoreUndefinedProperties`.\n    at validateUserInput (/app/node_modules/@google-cloud/firestore/build/src/serializer.js:271:19)\n    at Object.validateUserInput (/app/node_modules/@google-cloud/firestore/build/src/serializer.js:263:13)\n    at Object.validateDocumentData (/app/node_modules/@google-cloud/firestore/build/src/write-batch.js:577:18)\n    at CollectionReference.add (/app/node_modules/@google-cloud/firestore/build/src/reference.js:1957:23)\n    at Object.updateTask (/app/models/tasks.js:26:39)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)\n    at async addNewTask (/app/controllers/tasks.js:16:18)"}
2021-04-26T04:23:39.937692+00:00 app[web.1]: {"message":"Error while creating new task: Error: Value for argument \"data\" is not a valid Firestore document. Cannot use \"undefined\" as a Firestore value (found in field \"assignee\"). If you want to ignore undefined values, enable `ignoreUndefinedProperties`.","level":"error"}
2021-04-26T04:23:39.939108+00:00 app[web.1]: {"message":"::ffff:10.38.10.19 - - [26/Apr/2021:04:23:39 +0000] \"POST /tasks HTTP/1.1\" 500 96 \"https://dashboard.realdevsquad.com/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36\"\n","level":"info"}
2021-04-26T04:23:39.943104+00:00 heroku[router]: at=info method=POST path="/tasks" host=api.realdevsquad.com request_id=c3edf7c9-dccc-44a5-8867-2d93e78fa380 fwd="174.127.238.68" dyno=web.1 connect=0ms service=594ms status=500 bytes=656 protocol=https
2021-04-26T04:23:50.553861+00:00 app[web.1]: {"message":"::ffff:10.37.108.111 - - [26/Apr/2021:04:23:50 +0000] \"OPTIONS /tasks HTTP/1.1\" 200 0 \"https://dashboard.realdevsquad.com/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36\"\n","level":"info"}
2021-04-26T04:23:50.558325+00:00 heroku[router]: at=info method=OPTIONS path="/tasks" host=api.realdevsquad.com request_id=8d0c8623-4afe-4554-badb-8d4edb0aeb81 fwd="174.127.238.68" dyno=web.1 connect=0ms service=3ms status=200 bytes=540 protocol=https
2021-04-26T04:23:51.296738+00:00 app[web.1]: {"level":"error","message":"Error in creating task Value for argument \"data\" is not a valid Firestore document. Cannot use \"undefined\" as a Firestore value (found in field \"assignee\"). If you want to ignore undefined values, enable `ignoreUndefinedProperties`.","stack":"Error: Value for argument \"data\" is not a valid Firestore document. Cannot use \"undefined\" as a Firestore value (found in field \"assignee\"). If you want to ignore undefined values, enable `ignoreUndefinedProperties`.\n    at validateUserInput (/app/node_modules/@google-cloud/firestore/build/src/serializer.js:271:19)\n    at Object.validateUserInput (/app/node_modules/@google-cloud/firestore/build/src/serializer.js:263:13)\n    at Object.validateDocumentData (/app/node_modules/@google-cloud/firestore/build/src/write-batch.js:577:18)\n    at CollectionReference.add (/app/node_modules/@google-cloud/firestore/build/src/reference.js:1957:23)\n    at Object.updateTask (/app/models/tasks.js:26:39)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)\n    at async addNewTask (/app/controllers/tasks.js:16:18)"}
2021-04-26T04:23:51.297117+00:00 app[web.1]: {"message":"Error while creating new task: Error: Value for argument \"data\" is not a valid Firestore document. Cannot use \"undefined\" as a Firestore value (found in field \"assignee\"). If you want to ignore undefined values, enable `ignoreUndefinedProperties`.","level":"error"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at models/tasks.js:26 and trace the task-creation path from controllers/tasks.js:16 for POST /tasks. Reproduce the failure and inspect how the assignee value reaches the Firestore document. Done means creating a task no longer returns the logged 500 error when assignee is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.