Skip to content

Bug: ribbon-async-getpressed-signature #505

Description

@drmoisan
  • Work Mode: full-bug

Summary

RibbonViewer.SpamBayesEnabled_GetPressed and RibbonViewer.TriageEnabled_GetPressed are declared async Task<bool>, but the Office ribbon getPressed callback contract requires a synchronous bool GetPressed(Office.IRibbonControl control). Office cannot bind a callback whose return type is Task<bool>, so the "SpamBayes Enabled" and "Triage Enabled" toggle buttons never reflect the real engine activation state.

Environment

  • OS/version: Windows 11, Outlook desktop (VSTO add-in host)
  • Runtime: .NET Framework 4.8.1, TaskMaster VSTO add-in
  • Command/flags used: Outlook Explorer ribbon, Spam Manager and Triage configuration menus
  • Data source or fixture: TaskMaster/Ribbon/RibbonExplorer.xml embedded resource

Steps to Reproduce

  1. Open Outlook with the TaskMaster add-in loaded and let initialization complete.
  2. Open the Spam Manager save-options menu and observe the "SpamBayes Enabled" toggle button.
  3. Toggle the engine off via SpamBayesEnabled_Click, then reopen the menu.
  4. Repeat for the "Triage Enabled" toggle button.

Expected Behavior

The toggle button's pressed state reflects Globals.Engines.EngineActiveAsync(<engineName>) - pressed when the classifier is activated, unpressed when it is not - and updates when the engine is toggled.

Actual Behavior

Office resolves getPressed by name and requires the exact signature bool GetPressed(IRibbonControl control). Both methods return Task<bool>:

public async Task<bool> SpamBayesEnabled_GetPressed(Office.IRibbonControl control) =>
    await Controller.Engines.EngineActiveAsync(SpamBayes.GroupName);

public async Task<bool> TriageEnabled_GetPressed(Office.IRibbonControl control) =>
    await Controller.Engines.EngineActiveAsync("Triage");

(TaskMaster/Ribbon/RibbonViewer.cs, Spam Config and Triage Config regions.)

The callback does not bind, so the pressed state is not driven by the engine configuration.

Logs / Screenshots

  • Attached minimal logs or snippet
  • Snippet: see the source excerpt above. Office does not surface a user-visible error for a signature-incompatible callback; the failure is silent unless Office is run with the "Show add-in user interface errors" developer option enabled.

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Two configuration toggles display a state that is not tied to the underlying setting. The commands themselves still work, so this is a state-display defect rather than a functional break, but it misrepresents engine configuration to the user.

Source

From: docs/features/potential/2026-08-08-ribbon-async-getpressed-signature.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions