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

App threw an error #71

Open
mishyy opened this issue Aug 4, 2022 · 3 comments
Open

App threw an error #71

mishyy opened this issue Aug 4, 2022 · 3 comments

Comments

@mishyy
Copy link

mishyy commented Aug 4, 2022

Let us know what you were doing when this bug happened:
Uploading Sleepmeter CSV to dashboard.

Technical information:
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15
Location: https://sleepdiary.github.io/dashboard/#/info
Error message:
[
[
"0",
[
"message",
"undefined is not an object (evaluating 'v[0].start')"
]
],
[
"1",
[
"line",
1
]
],
[
"2",
[
"column",
10765
]
],
[
"3",
[
"sourceURL",
"https://sleepdiary.github.io/dashboard/js/info.3b696c1e.worker.js"
]
],
[
"4",
[
"stack",
"y@https://sleepdiary.github.io/dashboard/js/info.3b696c1e.worker.js:1:10765\n@https://sleepdiary.github.io/dashboard/js/info.3b696c1e.worker.js:1:10112\n@https://sleepdiary.github.io/core/sleepdiary-core.min.js:59:394\nonmessage@https://sleepdiary.github.io/dashboard/js/info.3b696c1e.worker.js:1:11741"
]
],
[
"length",
5
]
]

@andrew-sayers
Copy link
Contributor

Thanks for the report! It looks like the dashboard thinks your diary is empty, and line 69 of info.js is the first thing to get confused.

Assuming your diary isn't actually empty, the most likely issue is that dates are being stored in a format we don't yet recognise. Would you mind providing the first few lines of the CSV file, so I can figure out what's up? If you're not comfortable sharing them in a bug report, feel free to e-mail them to me instead (search for "email" in this GitHub data dump).

I'm in the middle of a pretty hectic summer right now, and I'm not even expecting to sit at a computer until next week. If you're comfortable with GitHub/e-mail, I'll try to look at this later in the month. Or if you don't mind waiting, I'll be happy to talk about it on Discord when things calm down. Sorry for the delay.

@mishyy
Copy link
Author

mishyy commented Aug 6, 2022

Yeah sure:

wake,sleep,bedtime,holes,type,dreams,aid,hindrances,tags,quality,notes
"2022-08-04 06:45+1000","2022-08-04 01:00+1000","2022-08-04 00:30+1000",,NIGHT_SLEEP,NONE,MELATONIN,NONE,COUCH,5,"MELATONIN @ 2150"
"2022-08-03 11:15+1000","2022-08-03 02:45+1000","2022-08-03 02:15+1000",,NIGHT_SLEEP,NONE,MELATONIN,NONE,COUCH,5,"MELATONIN @ 2140"
"2022-08-02 11:40+1000","2022-08-02 03:45+1000","2022-08-02 03:15+1000",,NIGHT_SLEEP,NONE,MELATONIN,NONE,COUCH,5,"MELATONIN @ 2125"
"2022-08-01 11:00+1000","2022-08-01 01:45+1000","2022-08-01 01:15+1000",,NIGHT_SLEEP,NONE,MELATONIN,NONE,COUCH,5,"MELATONIN @ 2200"

@andrew-sayers
Copy link
Contributor

Sorry again for the delay - my todo list is finally trending in the right direction, so I've had a quick look now and will have more time next week.

I'm afraid the snippet above doesn't trigger the bug, which suggests the problem is just with one specific line somewhere in the middle of your diary. That means we've got two choices...

If you'd rather not share your full diary, you can find the offending line with this procedure:

  1. work out how many lines there are in your file (e.g. load it in Excel and count the rows)
  2. create a new CSV file with just the top half of the file (so if you have 1,000 rows in Excel, paste the first 500 rows into a new spreadsheet and save that as CSV)
  3. load your new top-half CSV into the dashboard and make a note of whether it triggers the bug
  4. if the bug comes back, start from step 1 with the top-half file (so you'd start with 500 rows and paste the first 250 into a new CSV)
  5. if the bug doesn't come back, start again with a CSV file containing the header row (wake,sleep,bedtime,holes...) and the rows you deleted in step 2 (so you'd paste the last 500 rows into a new CSV)
  6. after a surprisingly short number of loops, you should be able to trigger the bug with a file small enough to share

Or if you don't mind me seeing the full diary, you can send it to me as discussed above (e-mail now or Discord next week).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants