Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying ticks for a climb sometimes fails with "value.getTime is not a function" #438

Closed
Vichy97 opened this issue Dec 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Vichy97
Copy link
Collaborator

Vichy97 commented Dec 20, 2024

This is an example response for the climb 673817a585aaf48df33e1fbf

  "errors": [
    {
      "message": "value.getTime is not a function",
      "locations": [
        {
          "line": 6,
          "column": 7
        }
      ],
      "path": [
        "climb",
        "ticks",
        13,
        "dateClimbed"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR"
      }
    }
  ],
  "data": {
    "climb": {
      "ticks": [
        {
          "_id": "673817a585aaf48df33e1fbf",
@Vichy97 Vichy97 added the bug Something isn't working label Dec 20, 2024
@wkencel
Copy link
Contributor

wkencel commented Dec 21, 2024

I think I resolved this issue

the issue was in the date handling in tick mutations which I verified using graphql on the apollo client

Previously, dates in tick mutations were being stored as null in some cases. This change:

  1. Ensures dates are properly converted to timestamps when creating/updating ticks
  2. Maintains compatibility with existing tick date formats

The change allows proper date storage and retrieval

Looking at the output, I can see that the dateClimbed is now correctly saved as a timestamp (1469016615000) instead of null!
Screenshot 2024-12-21 at 9 06 23 AM

@wkencel
Copy link
Contributor

wkencel commented Dec 21, 2024

Here are my repros of the issue before the change
Repro1
repro2

I need to make sure my change adheres to the typescript enforcement. I'll have a PR up before tomorrow :-)

@Vichy97
Copy link
Collaborator Author

Vichy97 commented Jan 3, 2025

@wkencel thanks for that fix! If you are confident this is resolved, feel free to close the issue

@wkencel
Copy link
Contributor

wkencel commented Jan 4, 2025

I don't think I have the permissions to close it. But I've made the change, got the PR approved and merged. May you close it please if you have the permissions to?

@julianlam
Copy link

#439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants