#useEventRunDetails

1 messages · Page 1 of 1 (latest)

elfin perch
#

I have a fairly simple component to test this hook..

import { useEventRunDetails } from "@trigger.dev/react";
import { Text, BlockStack } from "@shopify/ui-extensions-react/admin";

export default function EventRunData({ id }) {
  const { isLoading, isError, data, error } = useEventRunDetails(id);
  console.log(isLoading, isError, data, error);

  if (isLoading || !data) {
    console.log("loading...");
    return <Text>loading...</Text>;
  }

  return (
    <BlockStack gap>
      <Text>status: {data.status}</Text>
      {data.tasks.map((task) => (
        <Text key={task.name}>
          {task.status}: {task.name}
        </Text>
      ))}
    </BlockStack>
  );
}

From what I understand it's to continue to update until the run has completed.

But it displays about half the tasks and gets stuck on status executing.

Once the run is complete, if I send in the event ID in again, it'll show all the tasks are completed and that the run has a status of success.

So the issue is, is that we are not getting automatic updates.

daring grove
#

This is definitely a bug. If you open the web inspector do you get some errors coming in? I’m wondering if our new API rate limit is impacting the React hooks.

elfin perch
#

No errors in the console. As you can see I'm logging isError which has always been false, and error has always been null

daring grove
#

Does your job have a lot of very fast changes? Trying to figure out why I’ve not seen this before so we can figure out a fix

elfin perch
#

Looking at a run..

the first 3 tasks are logs which each take "0ms", then we have a longer task of about 20 seconds with 3 subtasks, then another couple of tasks that are 20-30 seconds each.

daring grove
#

Ok nothing crazy. You're awaiting all of the tasks/logs?

elfin perch
#

we've reviewed it. it seems to work well on nextjs, but running on remix we're not getting all the tasks from the hook. Any knowledge of this working differently in different frameworks?