OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
657 stars 93 forks source link

🔥🐛 Contextual tabs mechanism not working at all with Office.StartupBehavior.load #3052

Open wh1t3cAt1k opened 1 year ago

wh1t3cAt1k commented 1 year ago

Provide required information needed to triage your issue

Blocker for us. In Excel Online, when the start-up behaviour is set to "load", the contextual tab does not get displayed at all.

Therefore, upon first launch in a new workbook, the ribbon appears, but on subsequent opens of the same workbook, nothing gets shown.

Your Environment

Expected behavior

Ribbon appears

Current behavior

Ribbon does not appear

Steps to reproduce

Use this sample repository to reproduce: https://github.com/VelixoSolutions/repro-missing-ribbon-online

  1. Start the dev server and sideload the manifest into Excel Online.
  2. Create a new workbook and click the add-in button on the ribbon, this will launch its code and "requestCreateControls".
  3. After a couple of seconds, the contextual tab will appear.
  4. Reload the page.
  5. Click the add-in button on the ribbon.
  6. Observe the task pane is open, but no ribbon appears anymore.

It only works on new workbooks you create but not on the existing ones where the start-up behaviour has been registered.

Context

We have an ongoing UI revamping effort where many of the flows will rely on contextual tabs instead of the (now-crowded) side panel. With this issue, it's completely impossible Online.

At the same time, we cannot change our start-up behaviour because our add-in attaches handlers and helper functionalities that need to run without the user explicitly clicking on the add-in button.

Useful logs

No error is shown in console, it simply does not appear. I also consider this a problem.

ghost commented 1 year ago

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

ruijiaMS commented 1 year ago

Hi @wh1t3cAt1k, I did not repro this issue via your steps. Could you please provide a screen record video to help me understand how this issue works. Thanks!

wh1t3cAt1k commented 1 year ago

@ruijiaMS @RuizhiSunMS it's very easily reproducible using the steps / minimal repro repository from the bug description.

Here is the video:

https://www.youtube.com/watch?v=S597XXwN7Bw

yuc014 commented 1 year ago

Hi @wh1t3cAt1k , Here is my screen recording, seems not repro your issue, is my step wrong?

https://user-images.githubusercontent.com/87364252/209280954-7903afbf-2439-446a-ba3d-d19376e84db8.mp4

https://user-images.githubusercontent.com/87364252/209281542-8204b90f-995e-4d29-93a9-6fbe94a3c72f.mp4

wh1t3cAt1k commented 1 year ago

@yuc014 by any chance, do you use "disable caching" on the network tab your dev tools?

Have you tried editing the workbook and waiting a little more time after the ribbon shows the first time? (and only then reloading the workbook)

It replicates every single time for us. Could it be some sort of race / timing issue?

wh1t3cAt1k commented 1 year ago

Session ID when ribbon is showing: 5c885ecb-2a37-46ef-8459-9c3d90e58e42

Build: 16.0.16019.42303 (is the build number similar for you?)

URL is like this:

https://velixo-my.sharepoint.com/:x:/r/personal/pkabir_velixo_com/_layouts/15/doc2.aspx?sourcedoc=%7BEA3A2A3A-95EA-4E67-8F85-55BA25A918F9%7D&file=Book%20176.xlsx&action=editnew&mobileredirect=true&wdNewAndOpenCt=1671832104341&ct=1671832104341&wdPreviousSession=ed71c1fc-bc4a-4ea4-b659-3cc4b747974a&wdOrigin=OFFICECOM-WEB.MAIN.NEW

When I reload the page, the ribbon is not showing.

Session ID when not showing: 6f499cc9-401f-4f8a-99c5-3cf8115d82d7

Please check the logs and see the differences. Please also try to replicate on someone else's machine... As I mentioned, the issue is 100% reproducible every time for us.

Maybe a race, or intervention of other add-ins that you have installed - I am doing my experiment on a Chrome browser with 100% all-time cache cleared and no add-ins installed beside Script Lab.

wh1t3cAt1k commented 1 year ago

@ruijiaMS @yuc014 @Wenjun-Gong dear friends, we can't proceed with an important UX revamping with this issue present, may we please ask you to check the session IDs above and inform us of any resolutions or workarounds? Thank you.

yuc014 commented 1 year ago

Hi @wh1t3cAt1k, sorry for the late response.

My environment: Build: 16.0.16110.42303 Disable cache in browser.

And I also tried clean cache, uninstall my add-ins, edit workbook and wait for a while, still cannot repro.

For the URL you provided, seems I cannot access your sharepoint. image You can share it with "Anyone with the link".

For the sessions you provided, I investigated it and didn't find typical error or something, attach session info below. Book24.xlsx

So, it's a little bit weird, I guess maybe the build number difference? I will see whether I can repro on the workbook you share.

wh1t3cAt1k commented 1 year ago

Do you have a different build number for office on the web? Is it some sort of internal preview channel? I will share the workbook later, too

wh1t3cAt1k commented 1 year ago

@yuc014 can you try enabling cache in the browser too? Maybe this is important?

yuc014 commented 1 year ago

@wh1t3cAt1k I tried my personal account (now Build:16.0.16109.42300), which should use the same channel with you. And tried enabling cache, but still cannot repro it.

wh1t3cAt1k commented 1 year ago

@yuc014 please see the below video if you can replicate or not.

https://www.youtube.com/watch?v=wlJeVm2d9sk

Please also consider asking a colleague to repro, there might be something else going on with your environment? Are you using a preview channel of office.js by any chance? I am just importing from your CDN.

image

Again, the bug 100% repro when reopening existing workbooks, never replicates on new workbooks.

My sessions:

4e144ce4-d255-44e9-95b3-510a0c55f17a - does not work (old workbook) a888d85f-a4bd-4eac-8d8d-6b6becbadbad - does work (new workbook)

@Wenjun-Gong @yuc014 I think if replication does not succeed maybe another team member can try from your side?

I am open for a live call to demonstrate the issue and troubleshoot together with you, any time zone. Thank you.

wh1t3cAt1k commented 1 year ago

@yuc014 I also noticed that you have a lot of other add-ins installed. They may affect the picture that you're seeing. Velixo add-in (in my previous video) and Contoso add-in (in my repro example) were the only add-in I had installed. And please make sure you wait a little bit after reloading the page before clicking the add-in ribbon button.

wh1t3cAt1k commented 1 year ago

@ruijiaMS @yuc014 @Wenjun-Gong dear friends, I would like to follow up on the above - we're still blocked by this...

Wenjun-Gong commented 1 year ago

@yuc014 to follow up further and see whether it can be reproed.

@wh1t3cAt1k how frequently are you seeing this issue from your customers?

yuc014 commented 1 year ago

Hi @wh1t3cAt1k, for the addin you provided in the video ("Velixo"), I can repro your issue. I created an internal bug#7498343 to track it, our engineers will investigate it.

Additional information:

  1. I noticed that if you uninstall and reinstall Velixo, the contextual tab will show. Maybe this is a direction.
  2. Don't need copy&paste the url, refresh could repro it.
  3. I see there are seldom add-ins have contextual tab (cannot find another example), many of them use custom tab instead, like "Script Lab". Maybe use custom tab could unblock you.

Will update when the bug has progress.

wh1t3cAt1k commented 1 year ago

@Wenjun-Gong we had several support requests already, since our help documentation frequently mentions ribbon buttons, when people don't see it, they reach out, confused (also, even though we provide fallback buttons on the task pane, it looks crowded now and is not the best UX)

To the best of our knowledge, every customer who uses Excel Online is impacted by the bug. Some of our Mac clients use Excel Online too for performance reasons (since the are fewer memory limitations than in Safari for heavy calculations).

wh1t3cAt1k commented 1 year ago

@Wenjun-Gong @yuc014

As a follow-up,

I have tried that setting a different start-up behaviour "None" leads to the same result at least for one member of our team (ribbon doesn't show for existing workbooks after the start-up behaviour has been recorded once).

Maybe the bug manifests because of the fact that OfficeCore.AppRuntimePersistenceService is used at all, not necessarily the "Load" behaviour specifically...

Furthermore, I have discovered one suspicious place in the framework code (excel-web-16.00.debug.js):

image

Could this delay have been the source of inconsistent repro between me and you?

The fact that the code relies on delays feels strange for sure, might be promising to investigate on your side.

zpfaltersack commented 1 year ago

@Wenjun-Gong I'm intending to use this same combination of features in my product in an upcoming release (1-1.5 months out ideally) and just did a quick first pass to test it out, and the broken behavior manifests 100% of the time for me. I can only use either startup behavior OR contextual tabs but not the two together. In case it's relevant, we are distributed as a Custom App through admin center.

wh1t3cAt1k commented 1 year ago

Something that can shed additional light on the issue is an error that I see only on Excel Desktop for Windows (even though the problem never reproduces on Windows):

image

I can guarantee we only call requestCreateControls once (I tested this scenario multiple times and the breakpoint only gets hit once). Is it because of the AppRuntimePersistenceService that it thinks we have already created the controls? Can this be linked to the issue we're seeing in Excel Online?

Based on this finding, I tried this: back in Excel Online, upon opening existing file (where start-up behaviour was already recorded), I tried not invoking requestCreateControls and only asking for requestUpdate. However, the ribbon did not appear, and this time I saw an error in the console:

image

Overall, I am not sure what's going on 🤷‍♂️

wh1t3cAt1k commented 1 year ago

Hi @yuc014, just wanted to follow up and ask if the engineers have been able to identify / fix the root cause?

yuc014 commented 1 year ago

@wh1t3cAt1k , sorry for the inconvenience. One of our engineers are working on this work item, haven't identify the root cause now. Will update when have process.

ruijiaMS commented 1 year ago

Hi @wh1t3cAt1k Thanks for your patient here! I looked into this issue and double confirmed that both this issue and 2876 have the same root case by searching the telemetry log. They have been tracked by bug 7456551. Partner team who found the root cause is working on the fix. I will update here when complete the fix! Thanks!

wh1t3cAt1k commented 1 year ago

Hi guys (@ruijiaMS @yuc014 @davidchesnut) - it has been a while and we're still blocked by the issue. Could I ask for the fix's ETA and the fix version? Will it be done at the host level, or in Office.js library?

zpfaltersack commented 1 year ago

I'm also about to move on to building our feature that would leverage this functionality, and I'm trying to decide if I should find an alternative mechanism or if I can reasonably build around this combination of functionality and get the fix date to align with our release date. Any insight on timelines would be really helpful.

4tti commented 1 year ago

Same here :(

Wenjun-Gong commented 1 year ago

@ruijiaMS or @RuizhiSunMS, could you share whether there is any progress for this one?

ruijiaMS commented 1 year ago

@wh1t3cAt1k @Wenjun-Gong Thanks for your patient and reminder here. This issue had been fixed one week ago and it is waiting for deployment. The ETA for customers is around the end of March.

wh1t3cAt1k commented 1 year ago

@ruijiaMS thank you for the update.

Just curious, will it be fixed at the office.js level, or is it the host app? If the latter, is there an approximate fix version?

ruijiaMS commented 1 year ago

It is fixed in server side. Sorry for that we cannot get the approximate fix version yet, however, will post here if it comes up.

wh1t3cAt1k commented 1 year ago

@Wenjun-Gong @ruijiaMS

Has it been deployed already? We are observing that our contextual tabs are not disappearing anymore in Excel Online.

ruijiaMS commented 1 year ago

@wh1t3cAt1k If you are working on Excel Online, it has been deployed already. But for Excel desktop, it is on Preview now and waiting for Production deployment.

wh1t3cAt1k commented 1 year ago

Oh, I didn't know it replicated in Excel Desktop. For us the bug only reproduced on Excel Online 🤔🤔🤔

We'll do additional testing to make sure.

wh1t3cAt1k commented 1 year ago

@ruijiaMS @Wenjun-Gong our internal testing confirms that this particular ribbon issue is gone for us.

Unfortunately on "corrupted" files that were created prior to your fix, it seems that the customers still need to remove and reinstall the add-in, but it's a one-off operation for old documents only.

Great job MS team, you unblocked us in the direction of proper ribbon-oriented UI, and we cleared the side panel from a lot of buttons :) 💖

In this "epic", we are now hoping for your attention to https://github.com/OfficeDev/office-js/issues/2877 and https://github.com/OfficeDev/office-js/issues/3250 - with ribbon-oriented UI, we would like to depend on the status bar to avoid showing the side panel for long-running operations... Right now it's unreliable.

This item I am gladly closing.

wh1t3cAt1k commented 12 months ago

@ruijiaMS @Wenjun-Gong possibly linked to https://github.com/OfficeDev/office-js/issues/3476 – we're still experiencing intermittent ribbon "outages" but only on sideloaded add-ins.

JuliaKassina commented 11 months ago

Hi @ruijiaMS, @RuizhiSunMS, the issue is still replicated for me in Excel Online (Chrome). Here are the replication steps:

  1. In Excel Online open a new workbook
  2. In the ribbon, click Insert > Add-Ins
  3. In the Office Add-ins dialog box, go to the Store tab and search for Velixo
  4. Near the found Velixo add-in click Add
  5. In the appeared License terms and Privacy policy window, click Continue

As a result, the side panel of the added add-in will appear, but in the ribbon, the tab won't be added: image

To make the tab appear in the ribbon:

  1. Right Mouse Click in the side panel and click Reload.
  2. In the ribbon, click Home > Velixo As a result, both - side panel and tab will appear: image

Session ID: ad2d1f83-25c6-ddef-8cb9-ff28340e8a16 Link to the video recording of the issue: https://www.loom.com/share/6f5c2011dc8b428788cedb52e36dc450?sid=ebd34e42-56fd-45ce-9b4a-6e867662ca71

gmichaud commented 11 months ago

I am experiencing this problem constantly as well. It's only a problem on Excel Online.

wh1t3cAt1k commented 11 months ago

@Wenjun-Gong @ruijiaMS @RuizhiSunMS we're hoping for some attention to this problem as it really hinders our ability to pre-release test using a sideloaded manifest...

wh1t3cAt1k commented 10 months ago

@Wenjun-Gong can we please revisit this problem? It's a high-priority problem for us during internal testing and it produces a really bad impression on the customer in production.

In addition to other arguments, this issue does not allow us to reliably E2E test our add-in since the ribbon does not always appear when we run our tests, and even multiple side panel reloads don't always help.

gmichaud commented 10 months ago

I'm also constantly seeing this problem with Excel Online when using our store based add-in. Not a problem on Excel for Windows or Excel for Mac.

Wenjun-Gong commented 10 months ago

Hi @wh1t3cAt1k and @gmichaud , team is looking at this issue. Thanks for your patience.

ZYUN-MSFT commented 10 months ago

Hi @wh1t3cAt1k ,

There is one thing that I want to confirm. Are you re-open this issue because of issue #3476 ?\ Since my colleague and I all can't repro this issue, we are not seeing any trend that this issue/bug re-happen again.

First for #3476 , we have transfer it to the right owned team previously. But I apologize that I didn't keep monitor it in time. I'll fully support you for solving this issue by keep driving this all the time in the following.

Second for this issue. Please provided more repro detail information for us to tracking since we can't repro it.\

Sincerely, Yun.

wh1t3cAt1k commented 10 months ago

@ZYUN-MSFT not because of it, just because we discovered particular scenario is still replicable too. Our QA team (@JuliaKassina) will recheck and get back to you if it's still relevant.

JuliaKassina commented 10 months ago

Hi @ZYUN-MSFT, I just re-tested the scenario shared above following the exact same steps and the issue is still replicated for me.

Here are my replication steps:

  1. In Excel Online open a new workbook

  2. In the ribbon, click Home > Add-Ins > More Add-ins image

  3. In the Office Add-ins dialog box, go to the Store tab and search for Velixo image

  4. Near the found Velixo add-in, click Add image

  5. In the appeared License terms and Privacy policy window, click Continue image

As a result, the side panel of the added add-in will appear, but in the ribbon, the tab won't be added: image

Please, let me know, if you need any other information regarding the issue.

ZYUN-MSFT commented 10 months ago

Hi @JuliaKassina , thanks for your reply.

But unfortunatly I still cann't repro this problem. I delete my browser cache and try the steps you provided. And also the same office online version on Chrome Browser.

https://github.com/OfficeDev/office-js/assets/122421505/846daef5-65f1-43c8-a697-1ef6cac7f05b

Please check my screen record above.

Thanks.

JuliaKassina commented 10 months ago

Hi @ZYUN-MSFT , thanks for your quick response and attaching the video recording. I've noticed the 'Script Lab, a Microsoft Garage project' add-in added in your Excel. Then tested my scenario having 'Script Lab, a Microsoft Garage project' add-in added, but it doesn't change the output, the issue is still replicated on my side (with and without 'Script Lab, a Microsoft Garage project' add-in).

Can we have a screenshare meeting, where I will demonstrate you the issue (I'm available any working day from 7 AM to 6 PM UTC)? This issue is constantly happening for the whole our team and we need this to be resolved.

JuliaKassina commented 10 months ago

@ZYUN-MSFT , I also noticed on your video recording, that there is the 'My organization' tab on the Office Add-ins window. While in my case, there is no such a tab. image

I additionally recorded another video with the Console opened. Please take a look, hope this will give you some additional info: https://www.loom.com/share/34996fd87217420a893ae778c3a38f28?sid=4446b1ac-5cf9-4081-ba4a-6f70b782be48

ZYUN-MSFT commented 10 months ago

Hi @JuliaKassina , I think this issue is a little complex and we are investigating the root cause/right area of it. Please give us some time for investigation. And I will update the information here early next Week.

I will back here when we need your help for more detail information.

Thanks for your patience.

JuliaKassina commented 10 months ago

Thanks @ZYUN-MSFT, I've responded in the e-mail.

Any further progress regarding the issue will be posted here in comments.