Skip to content

bug: useRealtimeRun hook onComplete triggers on QUEUED state #2001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cachho opened this issue Apr 30, 2025 · 1 comment
Open

bug: useRealtimeRun hook onComplete triggers on QUEUED state #2001

cachho opened this issue Apr 30, 2025 · 1 comment

Comments

@cachho
Copy link

cachho commented Apr 30, 2025

Provide environment information

System:
OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 2.98 GB / 15.59 GB
Container: Yes
Shell: 3.7.1 - /usr/bin/fish
Binaries:
Node: 18.20.8 - ~/.local/share/nvm/v18.20.8/bin/node
npm: 10.8.2 - ~/.local/share/nvm/v18.20.8/bin/npm
pnpm: 8.6.3 - ~/.local/share/pnpm/pnpm

Describe the bug

Image

Reproduction repo

n/a

To reproduce

  const { run, error } = useRealtimeRun<typeof decryptLink>(runId, {
    accessToken: publicAccessToken,
    // eslint-disable-next-line @typescript-eslint/no-shadow
    onComplete: (run) => {
      console.log('🚀 ~ run (onComplete):', run);
      setIsLoading(false);
      if (run.output) {
        callback({
          url: new URL(run.output),
          isRandom: false,
          router,
        });
      }
    },
  });

Additional information

beta 4.11

the easiest fix is to check for the status in the onComplete callback

@cachho cachho changed the title bug: useRealtimeRun hook onComplete triggers on QUEUED` state bug: useRealtimeRun hook onComplete triggers on QUEUED state Apr 30, 2025
@cachho
Copy link
Author

cachho commented Apr 30, 2025

Actually, it only runs on QUEUED and not as intended on failed or completed.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant