Forge global page menu stopped working

Hello,

Since last Friday, we have encountered a huge issue with the Forge global page module. It’s also present in the project page and admin page modules, but let’s focus on the global page. Our global page consists of multiple sections, each with multiple entry points. We depend on this menu a lot.

So first, let’s look at part of the manifest.

jira:globalPage:
    - key: global-page
      resource: main
      layout: blank
      resolver:
        endpoint: backend
      title: Title
      icon: ${connect_baseUrl}/images/icon.png
      sections:
        - header: Dashboards
          pages:
            - title: Dashboard
              route: dashboard
              icon: ${connect_baseUrl}/images/icon.png
        - header: Repository
          pages:
            - title: Test cases
              route: test-cases
              icon: ${connect_baseUrl}/images/icon.png
            - title: Test cycles
              route: test-cycles
              icon: ${connect_baseUrl}/images/icon.png

The problem is that if we select Dashboard and then try to navigate to another page, for example, test cases, the navigation doesn’t work. It worked flawlessly for the past year, and only broke last week.

So how do we detect the changes, and where did we find the bug in Forge?

  1. We get the context

    import { view } from ‘@forge/bridge’;

    const context = await view.getContext();

  2. Because of how the menu works, we always receive info that we are inside the module global-page, so we had to use a different object to find the page the user selected. To retrieve the exact location of the user, we retrieve it from the URL. And here we see the issue. The object below is no longer updated. It stays the same as when the user first opened the app. Only a refresh fixes the issue.
    context.extension.location

Did you also encounter this problem? Is there any workaround? Is there a bug for this issue?

For the navigation part, the documented surface for routing inside a full page app, global pages included, is view.createHistory() rather than reading the location back out of context. It hands you a history object you point your router at, and Atlassian document wiring it up to React Router. If the menu is navigating client side without reloading the iframe, that’s the thing that stays in sync with the URL.

On whether this is a regression, I can’t confirm it either way and I’d rather say so than guess. The docs don’t state whether getContext() is a snapshot taken at mount or something that re-resolves on in-app navigation, and our own global page doesn’t use sections, so I’ve got nothing to compare against. What you’re describing, working for a year and changing last week with no changelog entry, is worth raising at developer.atlassian.com/support so it gets tracked as a behaviour change rather than sitting here.

We contacted Atlassian. Looks like the issue was caused by a recent update, which was reverted yesterday.