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
683 stars 95 forks source link

[Excel] RichApi.Error: ControlIdNotFound #4807

Open hdwatts opened 2 months ago

hdwatts commented 2 months ago

Provide required information needed to triage your issue

A subset of our clients are reporting that clicking a button in the ribbon of our Excel add-in appears to not do anything. The command itself is simple, if the user is authenticated (which we have confirmed they are in these cases) then enable the other controls in the ribbon.

We are accomplishing this by calling the below requestUpdate function for each of the other controls:

// The groupId, controlId, and enabled are passed in as variables
// as we go through the hard coded controls

await Office?.ribbon?.requestUpdate({
    tabs: [
        {
            id: 'Chrono.xConnectTab',
            groups: [
                {
                    id: groupId,
                    controls: [
                        {
                            id: controlId,
                            enabled,
                        },
                    ],
                },
            ],
        },
    ],
})

The group and control ids are hardcoded to match 1:1 with the IDs in our manifest file. This code works for the majority of our users and for us. However, a subset of our users frequently encounter an error with OfficeJS that hits our Sentry logs:

RichApi.Error: ControlIdNotFound
  at new n(/lib/1.1/hosted/excel-win32-16.01.js:25:265603)
  at i.processRequestExecutorResponseMessage(/lib/1.1/hosted/excel-win32-16.01.js:25:330050)
  at ? (/lib/1.1/hosted/excel-win32-16.01.js:25:328113)

Given that the Ribbon is visible and these control ids are hard coded, how can they not be found?

When we were debugging with the client, we found opening the taskpane and triggering a right click -> reload would fix the problem and the button functions as expected.

Your Environment

Expected behavior

Current behavior

Context

Useful logs

RichApi.Error: ControlIdNotFound
  at new n(/lib/1.1/hosted/excel-win32-16.01.js:25:265603)
  at i.processRequestExecutorResponseMessage(/lib/1.1/hosted/excel-win32-16.01.js:25:330050)
  at ? (/lib/1.1/hosted/excel-win32-16.01.js:25:328113)
microsoft-github-policy-service[bot] commented 2 months ago

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

shanshanzheng-dev commented 2 months ago

Hi @hdwatts Thanks for reporting this issue. Could you share us which add-in is hitting this error or your manifest? We'll investigate this root cause. Thanks.

hdwatts commented 2 months ago

Hi @shanshanzheng-dev - the addin can be found on the AppSource here.

The manifest can be found here: https://excel.chronograph.pe/xconnectjs-manifest.xml

Thank you for looking into this. I have a call with a client about this tomorrow so would appreciate any insight you may have.

hdwatts commented 2 months ago

Hi @shanshanzheng-dev and @m-hellesen

Our client has set up a weekly call with us to discuss our progress on this issue. Do you have any insight into this problem we can share with them?

shanshanzheng-dev commented 2 months ago

Hi @hdwatts It has been put on our backlog <bug #9278887>. we're triaging this issue. We'll report back if we have a suggestion for you. Thanks for your patience.

hdwatts commented 2 months ago

Thanks @shanshanzheng-dev - is there a link to the backlog I can share with the client?

shanshanzheng-dev commented 2 months ago

Hi @hdwatts, Sorry, the link is our internal backlog link and you have no access to open. But we'll report back if we have a update for you. We unfortunately have no timelines to share at this point.

hdwatts commented 1 month ago

@shanshanzheng-dev @m-hellesen Just checking in, anything I can communicate to our clients who are still experiencing this issue?

RuizhiSunMS commented 5 days ago

@hdwatts , sorry but here is no new update. Our colleagues are still working on it.