Skip to main content

getAppVersionStatus

Callable

  • getAppVersionStatus(init?: { signal?: AbortSignal }): Promise<AppVersionStatus | undefined>

  • Compares the version this document loaded with the version currently published as the current version.

    Reads the version this document runs from its own meta tag and asks the hosting endpoint for the version served now and the current version. The endpoint is asked at _twf/version below the current page's path (location.pathname, with a / appended when it does not end with one), so it works from any route of the app: the gateway answers there at any depth and resolves the application from the page path as it does for the page.

    While the host reports the current version as unknown, the status has current and isCurrent set to null; a caller should then claim neither a new version nor a pin.

    Resolves undefined when this document carries no version stamp (flat hosting, local development), without asking the endpoint at all, when the app is not version-hosted (the endpoint answers 404), when the request is aborted through init.signal and, after a console.warn, when the endpoint answers anything but a well-formed 200. A transient failure costs only the comparison: the version this document runs is known regardless, so a later call recovers the status.


    Parameters

    • optionalinit: { signal?: AbortSignal }
      • optionalsignal: AbortSignal

    Returns Promise<AppVersionStatus | undefined>