OfficeDev / microsoft-teams-apps-champion-management

Champion Management Platform is a custom Teams app that enables organizations to onboard and maintain champions/ SME in their organization in Teams.
MIT License
125 stars 48 forks source link

TypeError: Cannot read properties of undefined (reading 'toLowerCase') #185

Closed rfoust closed 7 months ago

rfoust commented 8 months ago

I'm configuring the Copilot CoE and the champion management app works fine with my admin account, but when I try to access the channel tab using any other account, I get the error:

TypeError: Cannot read properties of undefined (reading 'toLowerCase')

It doesn't matter if the other account was added as a user in the app or not. I've tried removing and reinstalling the tab/app/sharepoint data but the error persists. Note that the missing icon in the screenshot DOES show up after clicking OK.

Screenshot 2023-11-08 at 9 45 15 PM

v-chpaladugu commented 8 months ago

Hi @rfoust, Thanks for reaching out us. Can you please share the following files:

Thanks.

rfoust commented 8 months ago

Sure, see attached. I also included a zip file with the log/har files. Edit: the user list screenshot hadn't been refreshed after my reinstall - in reality it just has rfoust.a2, not rfoust currently. But the results are the same if I add my other user account.

Screenshot 2023-11-09 at 8 25 51 AM Screenshot 2023-11-09 at 8 26 31 AM teams-logs.zip

v-chpaladugu commented 7 months ago

Hi @rfoust, This is the error that causing issue for user account to access profile properties from SharePoint. Since it doesn't have privilege to access logged in user email, it is throwing the error. Error: "GET https://prodduke.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetMyProperties 403 (Forbidden)"

Please provide "Read" access to User account from SharePoint and check again.

Thanks.

rfoust commented 7 months ago

Thanks for the feedback. Can you explain that in more detail? The User.ReadWrite permission is already applied from what I can see: Screenshot 2023-11-10 at 8 11 53 AM

v-chpaladugu commented 7 months ago

@rfoust, Those are the permissions for Graph API access, but we need "Read" permission to be given to SharePoint root site for that particular user. Please follow the steps to give Read access to User.

Thanks.

rfoust commented 7 months ago

Still seeing the same error after adding the permission. But doesn't that just affect the user's permission to the site? Doesn't seem like that would modify the application's api permissions to read the user's profile, since that api call is a totally different URL.

v-saikirang commented 7 months ago

Hi @rfoust,

I see the membership ship list has 2 accounts from seperate tenants. Can you please confirm which account is working and which one is not. And also may I know how you added the second account to the membership list. Ideally you should be adding people from Add Members option from the dash board. Please let us know. Thanks.

v-saikirang commented 7 months ago

Hi @rfoust ,

I am closing this ticket since we didnt not get any response. Please re-open the ticket if you still have any issues. Thanks.