The discussion addresses a bug where private message inboxes for groups fail to load due to a capitalization error in the URL. RGJ reports that clicking a notification for a group like ExampleGroup attempts to load /topics/private-messages-group/username/examplegroup.json, which fails because the group name is lowercase. The issue arises from ListController::generate_message_route not handling case-insensitive group name lookups. angus suggests the problem may be in the post alerter, but notes that notifications created in the console work correctly. techAPJ clarifies that the correct fix is to allow case-insensitive group name matching in URL parameters, referencing a commit that implements this change. The issue is confirmed to be related to the URL generation for private message groups, and the community acknowledges the bug and the proposed solution.
I am not very familiar with private group inboxes and I’m not sure how to reproduce this but the following is happening:
A private message inbox has been set up for a group, let’s call it ExampleGroup.
A member of that group gets a notification ‘there are 6 messages in your examplegroup inbox’
Clicking that notification tries to load /topics/private-messages-group/username/examplegroup.json
This gives an error
I think this is happening because there is no group called examplegroup. The group is called ExampleGroup.
ListController::generate_message_route does this:
group = Group.find_by(name: params[:group_name])
changing this to
group = Group.find_by(name: params[:group_name])
group = Group.where('lower(name) = ?', params[:group_name].downcase).first unless group
seems to resolve the issue. But I’m sure that is not the actual problem. Somewhere the parameter is converted to lower case where it should not be (I think…).
Note that browsing to /u/username/messages/group/groupname will fire an AJAX request to /topics/private-messages-group/username/groupname, so what @angus did above to debug this issue does look correct.