cubehouse / themeparks

Unofficial API for accessing ride wait times and schedules for Disneyland, Disney World, Universal Studios, and many more parks
MIT License
538 stars 126 forks source link

Park Times Incorrect in Disneyland #261

Closed Vortec4800 closed 4 years ago

Vortec4800 commented 4 years ago

Park Which park/resort has this issue? Disneyland and California Adventure

Context

Describe the bug

parkObj.GetOpeningTimes() is returning a bunch of closed dates for both California parks. Florida Disney parks are working fine. For example, in the output it shows that the park is closed today, along with the 9th, 10th, 11th, 12th, etc. See JSON output for example.

Output

[
  {
    "date": "2019-12-06",
    "openingTime": "2019-12-06T23:59:59-08:00",
    "closingTime": "2019-12-06T23:59:59-08:00",
    "type": "Closed"
  },
  {
    "date": "2019-12-07",
    "openingTime": "2019-12-07T08:00:00-08:00",
    "closingTime": "2019-12-07T22:00:00-08:00",
    "type": "Operating"
  },
// snip
  {
    "date": "2020-02-03",
    "openingTime": "2020-02-03T23:59:59-08:00",
    "closingTime": "2020-02-03T23:59:59-08:00",
    "type": "Closed"
  }
]
      ✓ should not error when fetching schedule
      ✓ should have schedule data
      ✓ should have a valid date for each schedule entry
      ✓ should have a valid opening time for each schedule entry
      ✓ should have a valid closing time for each schedule entry (68ms)

  14 passing (4s)
cubehouse commented 4 years ago

I can only partially reproduce this issue, so I have fixed what I can recreate and hope that helps.

Vortec4800 commented 4 years ago

Unfortunately this hasn't seemed to improve the issue. I'll attach the GetOpeningTimes() JSON from Disneyland Resort but it's saying the park is closed every day now.

In the meantime I'll see if I can dig through and see why this is happening, but at the moment I don't know what would cause it.

[
  {
    "date": "2019-12-08",
    "openingTime": "2019-12-08T23:59:59-08:00",
    "closingTime": "2019-12-08T23:59:59-08:00",
    "type": "Closed"
  },
  {
    "date": "2019-12-09",
    "openingTime": "2019-12-09T23:59:59-08:00",
    "closingTime": "2019-12-09T23:59:59-08:00",
    "type": "Closed"
  },
// snip
  {
    "date": "2020-01-06",
    "openingTime": "2020-01-06T23:59:59-08:00",
    "closingTime": "2020-01-06T23:59:59-08:00",
    "type": "Closed"
  }
]
Vortec4800 commented 4 years ago

I'm not totally clear on how this works, but I'm trying to trace how the park times come in for the DL Resort. On line 218 of disneyworldapibase.js we have a doc var with id dlr.calendar that seems like it should contain times based on what's processing on it. However, all the actual values seem to be empty. Here is the output of that doc var:

{
  "_id": "dlr.calendar.1_0.07-12",
  "channels": [
    "dlr.calendar.1_0"
  ],
  "closed": [],
  "id": "07-12",
  "lastUpdate": "2019-12-08T08:03:17Z",
  "mealPeriods": {},
  "parkHours": [],
  "privateEvents": [],
  "refurbishments": [],
  "parsedDate": "2020-12-07"
}

Notice the parsedDate is pointing to December 2020 - I don't know if that is a problem (or where that parsedDate even comes from) or if it's just a red herring.

Vortec4800 commented 4 years ago

Another update. The parsedDate issue isn't related. I think it may technically be a bug, but not important enough to worry about much. It's grabbing a time from yesterday which the lib thinks is for next year. Either way, not related for this particular issue.

I converted the disneylandresortmagickingdom.js file to extend DisneyLegacy instead of DisneyBase, and that's fixed the problem. I don't know if this is a good long-term solution or not, but either the Couchbase db format has changed for these resorts, or they're still primarily using the old API for these.

cubehouse commented 4 years ago

Looking at dlr.calendar.1_0.07-12, that is the database entry for December 7th 2020, which has no data yet, so the above looks correct to me. I guess the keys are re-used each year, so yesterday's date will be replaced on the server once the day is done?

Locally I can see that 08-12 and onwards looks correct for me. I've looked at how we're syncing and everything looks good.

I would try stopping your application and removing the themeparks.db and trying again. Did you at any point have two instanced of the library running at the same time or something unusual that may have caused some data to be corrupted?

Vortec4800 commented 4 years ago

No, haven't had two versions running at once at any point.

I did clear out the db and re-init all of npm just in case, and that did seem to solve my problem. Perhaps there was a cache from before I updated the library to the latest version you published and I was getting old data, and now I'm getting the fixed data.

I'll go ahead and close this out and monitor it to see if we need to do anything else.