Issue Panel crashes on Issue Update

Hi there,

I am currently working on an Issue Panel module for my App.
Since it’s a very simple implementation, I am using the UI-Kit…

Within the Issue Panel a function is called which updates a value in the Issue Panel causing a rerender.
Also within the Issue Panel, a new assignee is assigned for the issue. With Assigning the Issue, the Issue automatically updates. The update makes my Issue Panel crash. The Error Message is not that helpful: “Unexpected error in app An error occurred while trying to load this app.”

It seems, the Issue Update is the cause for the Problem. I wrapped all of my corresponding functions in try/catch blocks, but there are no Error logs in my console.

const SomeIssuePanelComponent = () => {
    const [someGroupMembers, setSomeGroupMembers] = useState([]);
    const [pickedUser, setPickedUser] = useState(null);
    const context = useProductContext();

    useEffect(async () => {
        setSomeGroupMembers(await getAllPotentialAgents());
        setPickedUser(
            await getAnIssueProperty(context.platformContext.issueId)
        );
    }, []);

    const anIssuePanelFunction = async (formProps) => {
        try {
            const issueId = context.platformContext.issueId;
            const AppUser = await getAppUser();
                let promises = [];
                promises.push(
                    saveAnIssueProperty(formProps.user, issueId)
                );
                promises.push(
                    sendNotification(formProps.user, issueId)
                );
                await Promise.all(promises);
                setPickedUser(formProps.user);
                await assignIssue(issueId, appUser.accountId);
        } catch (error) {
            console.log(error);
        }
    };

    return (
        <Fragment>
            {someGroupMembers.length > 0 && (
                <Fragment>
                    <Form
                        onSubmit={anIssuePanelFunction}
                        submitButtonAppearance="primary"
                    >
                        <Select
                            label="Set User and Notify"
                            name="user"
                        >
                            <Fragment>
                                {someGroupMembers.map((user) => (
                                    <Fragment>
                                        <Option
                                            label={user.displayName}
                                            value={user.accountId}
                                        />
                                    </Fragment>
                                ))}
                            </Fragment>
                        </Select>
                    </Form>
                    {pickedUser && (
                        <Fragment>
                            <Text>
                                Current User:
                                <User accountId={pickedUser} />
                            </Text>
                        </Fragment>
                    )}
                </Fragment>
            )}
        </Fragment>
    );
};

Thanks in advance,
Adrian

Hi! Were you able to solve this issue?

No.
I also was not able to find the cause.

Does this happen only when accessing the issue via the “View issue” button after creating it? Or does it always happen?

It’s occurring when updating the Issue via the API. The re-render of the issue is somehow creating an error in the customui frontend.

I’m having the same issue, but only only the first time I run my app in a new ticket.