pnp / spfx-reference-scenarios

Work repo for the SPFx in Teams samples
48 stars 40 forks source link

ace-teams-covid Issue #6

Closed jasonpeterson7234 closed 2 years ago

jasonpeterson7234 commented 2 years ago

Hello - I am having trouble getting the COVID check-in app to work within Teams. I have uploaded the spfx file into my SharePoint app catalog and then modified the manifest.json file to point to a specific SharePoint site. I was able to add the app to the Teams admin center and add it to the Teams web client. I can view the admin side under my login, but only in the web version. When I try to access on the desktop version of Teams it just spins and no data appears. Also, no other users can use the app either. It will just spin like it is trying to connect. It will display the app name and I can view the about section Screenshot desktop client Screenshot webapp .

juliemturner commented 2 years ago

Ok, so 1 piece at a time. If I understand correctly you've decided to do the custom manifest route, and point to a specific site collection. Let's take the desktop version out of the mix for a min and address the "other users" issue. When you say no other users can use the app either, can you be more specific?

With regards to the personal app not loading in the Teams Desktop client I think that was a known issue, and to be honest I thought it was supposed to be fixed, but I too am seeing it still. Effectively it's an authentication issue. If you navigate to a Team that has a SharePoint page linked as a Tab, the Teams client will load the SharePoint page, effectively authenticating you, and then if you navigate back to the Check-In personal app it will load. @VesaJuvonen could you please confirm if this fix is forthcoming or do I have this wrong?

jasonpeterson7234 commented 2 years ago

First about the "other users" issue. I am the only user that can access this app on either desktop client or web Teams. I tried the fix that you suggested and the app was able to work correctly on the desktop client after that. Is there an update I should apply to fix the desktop issue that I missed?

I did have another user try the same workaround with accessing a SharePoint site from within Teams and then open the app and they got the error that is attached Desktop Client Error .

juliemturner commented 2 years ago

What I'm not really getting is what you mean by only user that can access this app... does that mean they do not see the app. Or when they click on the app, they get an error of some kind or some behavior of some kind. Is the screenshot you just shared for one of these other users, and is that what they get in the Desktop client or the web client? What happens when a user other than yourself tries to access the app from the Teams web client.

Given the issues with the Desktop client can you just leave that out of the conversation for now and focus on the web client, to answer your question I don't know if there is a fix, I need some Microsoft insight on that one.

jasonpeterson7234 commented 2 years ago

The other users can see the app within the app store and can click on it. When it opens they see the app name at the top of the screen, COVID Attestation, and the About options. When they are on the COVID Attestation section they get nothing and it just spins.

juliemturner commented 2 years ago

Are you sure the other users have access to the site you set it up on? Can you have them try navigating to that site directly in a browser?

jasonpeterson7234 commented 2 years ago

I will double check permissions.

jasonpeterson7234 commented 2 years ago

I see that it was a permissions issue with the users I was testing with. I did not realize that they needed to be a member of the SharePoint site in order to use the app and submit answers. This will not work for our case because we can't have everyone's answers exposed to the entire company. Thank you for your help.

juliemturner commented 2 years ago

@jasonpeterson7234 -- I am pretty sure the documentation explains that the users only have to be in the viewer group. If you check the permissions of the lists that drive the solution you can see that it works based on admins refreshing and essentially coping the answers into a list the viewers do not have access to, solving the issue you're talking about. But whatever you decide obviously.

jasonpeterson7234 commented 2 years ago

I am not finding the documentation that states the necessary permissions for the site. When I add them to the view only group it does not work, only when they are added to the members group with edit rights.

juliemturner commented 2 years ago

You're correct there is nothing written that states permissions for the site. What I was referring to is that I thought the video explained that the lists were secured in that way, but maybe not. Regardless we can go back and add more details to explain the site and list permissions.

If you look at the custom lists that were created, they should have custom permissions that break inheritance... at least that's what the code was designed to do and has done in testing.

CovidCheckIn list removes the "viewer" group. SelfCheckIn list gives the "viewer" group contribute permissions.

When a user checks in, the record goes into the SelfCheckIn list because thats where they have rights to add items. The Admin page is constantly monitoring that list and when it finds a record moves it to the CovidCheckIn list. The catch of course is that you have to have the Admin page up for this to happen. You might also decide that even if people have access to the items in the CovidCheckIn list that they should not show up in search for them, so you could search off for that list in the advanced settings.

jasonpeterson7234 commented 2 years ago

I did verify that the permissions for the lists are correct as you stated. The issue that I am running into is that any user that needs to enter data into the app cannot unless they are a member with edit rights to the SharePoint site. If they are a visitor with view only rights the app will just show a spinning wheel once they click on it inside of Teams web client. See attached screenshot of user with view permissions in the SharePoint site and clicking on the app within the Teams web app.

image

juliemturner commented 2 years ago

That should absolutely not be the case... so, something else funky is going on. If this is the web app, can you open the browser console and see what (if any) errors show up. Any things logged to the console related to the app itself are going to have a 🔶 at the start of them so that can help you filter what's what... also, you deployed the solution to the tenant app catalog or did you create a site collection app catalog?

jasonpeterson7234 commented 2 years ago

Getting errors that it can't read properties.

image

juliemturner commented 2 years ago

As I said any errors related to this solution would have that orange diamond, and none of these do, they are effectively errors that Microsoft has in their own code... ugly, I know. HOWEVER... what's interesting here is that second error. ExtensionTabService: getAuthTokenForApp... that's Microsoft's code effectively saying it' cannot authenticate this user which would explain why you're seeing the spinning. What I don't particularly understand is why moving this same user into the Members group vs the Viewers group would change that. This isn't a guest user by chance? Also, again, did you deploy the solution in the tenant app catalog or a site collection app catalog?

jasonpeterson7234 commented 2 years ago

I deployed in the tenant app catalog and made available to all sites. The user is not a guest and has a license applied. So it is somehow an authentication issue which does seem weird.

jasonpeterson7234 commented 2 years ago

I am on version 1.0.0, is the update 1.13 available for this solution? If so how do I update? Sorry, I am new to all of this.

dcashpeterson commented 2 years ago

The current version of the app is 1.0.0. I think with 1.13 you are referring to the version of SPFx. We updated the app to use the latest published version of SPFx. You don't need to worry about that. This feels like there is something off with that test user. Given the authentication issue Julie mentioned it looks like they are not authenticating which would explain why the app is running. That error isn't in the COVID app code that error is coming from Teams. Is everything else working ok for that user? They can access other Teams resources?

jasonpeterson7234 commented 2 years ago

Yes, everything else is working fine. I have two other test users that I am working with and they are getting the same results. The app will not show any options, just a spinning wheel, unless they are members of the site.

dcashpeterson commented 2 years ago

I apologize if this seems like a basic question but can you confirm that the user is in the Visitors group for the site and not just given read access to the site?

In the site that has the app go to this URL https://.sharepoint.com/_layouts/15/user.aspx Click on the Visitors Group image

Ensure that user is in that group image

The other thing to make sure is that the group you are looking at is registered as the official Visitors group for that site. https://.sharepoint.com/_layouts/15/permsetup.aspx

I can pick this up tomorrow but have a few things I need to get to today.

jasonpeterson7234 commented 2 years ago

Yes, to both of your questions. They do belong to the default visitors group for the site.

juliemturner commented 2 years ago

So, @dcashpeterson and I did some testing, and we did re-validate that the solution works fine for users who are in the viewers group... So let me summarize what we think we know about your situation.

Does that summarize it completely?

jasonpeterson7234 commented 2 years ago

I am going to remove all setup that I have done and start from the beginning again and see if that helps solve the issue.

jasonpeterson7234 commented 2 years ago

I have recreated everything with a new SharePoint communication site. I uploaded the app into the tenant app catalog and uploaded the manifest into the Teams admin center. I double checked all of the permissions for the site and my test users can access the site. The issue that I have now is when the test users open the app from within the Teams app they are presented the image indicating the environment needs to be configured, even though the app has already been configured. What could be the cause of this?

image

juliemturner commented 2 years ago

Ok, well... I've never seen that particular image, and it's cut off so I can't see any of the error message you're indicating. When you say "Teams App" you do mean the web client right? What do you see when you go to this same app in the Teams web client? What happens when someone who's in the Members or Owners group does? Also, please verify that the lists that should be there to support the solution are showing up in the site contents list in the site?

jasonpeterson7234 commented 2 years ago

Yes, this is when a user in the view only group clicks on the Check-In app in the Teams web client. Users in the owners/members group get the Check-In app to open properly. Here is the bottom of the image from the Check-In app.

image

juliemturner commented 2 years ago

Ok, now that I can see the message I can tell where that's coming from. We're going to check on something in our testing environment, but I think I know what's wrong. I'll get back to you shortly.

jasonpeterson7234 commented 2 years ago

Thank you! That sounds promising.

juliemturner commented 2 years ago

Ok, so we think we figured out the issue. Effectively I was testing if the list CovidCheckIn exists to see if the configuration is valid. That's a bug, but in our testing our test user who is in the viewers group also had the sneaky LimitedAccess which allows them to see that a list exists but not see anything inside of it. So, the security is correct but we were able to validate that the system was configured because they can see that the list exists. Anyway, I've made a change so that it checks for the SelfCheckIn list instead which everyone who can use the system can see and that should solve the problem. You can download the new SPPKG file and upload it into your tenant app catalog and then (give it 5 or 10 minutes and make sure you clear your browser cache) it should start working.

jasonpeterson7234 commented 2 years ago

That worked! Thank you for your help on this. Any idea if there will be a fix for the desktop client issue?

juliemturner commented 2 years ago

Let me ping @VesaJuvonen and see if I can get any more info on it.

jasonpeterson7234 commented 2 years ago

Thank you!

juliemturner commented 2 years ago

@jasonpeterson7234 - You can follow along regarding the issue with the Personal App and Teams Tab's not loading in the desktop client here: https://github.com/SharePoint/sp-dev-docs/issues/7499

juliemturner commented 2 years ago

I'm going to close this issue as I believe it to be solved. The issue you're experiencing with the Desktop app, as I shared above is being handled in a separate thread and when fixed shouldn't require you to do anything else, but guidance will be posted there. Thanks for reaching out and sharing the details so we can get this issue solved for everyone.

juliemturner commented 2 years ago

@jasonpeterson7234 - We've worked out the issue with the manifest that is keeping the app from loading in the desktop client. I have updated the repo to include the new files and so if you follow the instructions to make a custom manifest again with the new files you should solve your problem, making sure the manifest version is 1.0.1. In your situation you will need to upload a new manifest into Teams admin to fix the problem. You can follow the instructions here to force the app to update quickly or you can wait for Teams to refresh it's cache of the manifest so that it will start working.

jasonpeterson7234 commented 2 years ago

Sorry to reopen this case, but we just started getting this image again when users in the visitors group try to open the check-in app from either the desktop, web, or mobile versions of Teams. To my knowledge nothing has changed and was working fine earlier this week. Could this be a change on the Microsoft side?

jasonpeterson7234 commented 2 years ago

image

jasonpeterson7234 commented 2 years ago

Correction, all groups no longer have access and get this generic image when opening the app in Teams on either desktop or web version.

jasonpeterson7234 commented 2 years ago

I think I may have fixed the issue. I did have to reupload everything.