I got a report that a user’s notifications would load when clicking on the avatar. (It’s a recent upgrade running 2.4.0.beta10). There is a single non-standard plugin, but it doesn’t seem likely to be the cause and the issue is affecting only one user (at least that we know of). (And then I did an upgrade without my plugin and that didn’t fix it.) safe-mode
didn’t help.
When going to /u/username/notifications
for one particular user no notifications are shown, but clicking on “responses”, “likes” and so on shows items in each of those types of notifications. I went into psql
and did a reindex table notifications
without error.
Clicking the avatar gets this error in the javascript console:
_application-4715c32620ba9b83af00144510f68ca0f0bae8f745edf2339e3f249ceee88c3f.js:77240 Uncaught TypeError: Cannot read property 'dasherize' of undefined
Looking at the code,
return [this.attach(notificationName.dasherize() + "-notification-item", attrs, {}, { fallbackWidgetName: "default-notification-item" }), (0, _virtualDom.h)("span.time", (0, _node.dateNode)(attrs.created_at))];
it appears to me (and this could be wildly off base) that the issue is that it’s getting an error or nil/null/empty when getting the notifications?
I can get the user notifications in rails without incident:
pry(main)> Notification.where(user_id: 870).count
=> 372
# this also returns stuff:
u=User.find(870)
Notification.recent_report(u)
I’m out of ideas.