Projects/Reviews bug when you delete a note
dwertheimer opened this issue · comments
I deleted a project note today which i didn't need anymore. Now Dashboard won't load anymore.
So there are really 2 bugs:
- Projects should be resilient enough to survive a missing note in the review list
- Dashboard should not have zero content if projects fails
Log:
2024-03-06 15:20:43 | DEBUG | getDataForDashboard :: ---------------------------- Looking for Project items for section #5 -----------------------------
2024-03-06 15:20:43 | DEBUG | jgclark.Reviews v0.13.0 :: Starting getNextNotesToReview())
2024-03-06 15:20:43 | DEBUG | dashboard/getNextNotesToReview :: - Next to review = 'Migrating Plugin Documentation'
2024-03-06 15:20:43 | DEBUG | dashboard/getNextNotesToReview :: - Next to review = '⭐️ NP: Overdue React'
2024-03-06 15:20:43 | DEBUG | dashboard/getNextNotesToReview :: - Next to review = 'Passport Renewals'
2024-03-06 15:20:43 | DEBUG | dashboard/getNextNotesToReview :: - Next to review = 'Anique Room Reno 2023'
2024-03-06 15:20:43 ❗️ERROR❗️ jgclark.Dashboard v1.0.0-a1 :: {
"message": "undefined is not an object (evaluating 'n.filename')",
"line": 29222,
...
"name": "TypeError"
}
In case it's helpful, the failing line is on the last line of this code (which has been transpiled, but variable names should match your actual code):
const nextNotesToReview = getNextNotesToReview(6);
if (nextNotesToReview) {
let itemCount = 0;
nextNotesToReview.map((n => {
var _n$filename;
const thisID = "".concat(sectionCount, "-").concat(itemCount);
const thisFilename = (_n$filename = n.filename) !== null && _n$filename !== void 0 ? _n$filename : "<filename not found>";
```
@jgclark I found the reviews list file and deleted that line, so I'm fine, but I wanted to report the bug.
Thanks. This has already been fixed in the development branch of Dashboard, which I'm hoping to release soon.
Ok but it failed for me on the branch you shared (not the released version)