Do apps timeout?


I am trying to fetch from a url, and in the meantime the app will crash:

# Unexpected error in app

An error occurred while trying to load this app.

* Refresh app

With no other error, is there any timeout on waiting for an update? Is there a way to increase the timeout or have the request happen in the background to not incur it?



import ForgeUI, { render, Fragment, Text, Button, IssuePanel, useState, Table, Head, Row, Cell } from '@forge/ui';
import api from '@forge/api';
import { useIssueProperty } from '@forge/ui-jira';

const getFixes = async (issueId) => {
  const res = await api.fetch('' + issueId);
  return res.json()

const App = () => {
  const [jobs, setJobs] = useIssueProperty("jobs", [2238765]);
  // const [result, setResult] = useState(async () => await getFixes(2238765));
  const [result, setResult] = useState({"Fixes": [{"Job": 'j1', "Status": "s1"}]});
 // This log happens the second time  but after the app has error'd, which leads me to think there is some timeout.
  return (
        onClick={() => {
          setResult((async () => {return await getFixes(jobs[0])})());
          //setResult({"Fixes": [{"Job": 'j2', "Status": "s2"}]});
        }} />

export const run = render(
    <App />

Yes, apps timeout after 10 seconds. See invocation limits.

There isn’t currently any way to increase the timeout or background a request.

1 Like