Skip to content

Import: report a job Studio stopped following as outcome unknown, not failed #1939

Closed

Description

@dawsontoth

Problem

waitForJob (src/integrations/api/instance/database/getJob.ts) follows an import's Harper job until it is COMPLETE or ERROR. It can stop following in two other ways, and both are reported as a plain failure even though the load may still be running on the server:

  • Five get_job polls fail in a row: it rethrows the last poll's error (if (consecutiveFailures >= 5) throw err;). For example, the instance stops answering for a few seconds, or a gateway returns 502s.
  • The 10-minute deadline passes while the job is still running: it throws Timed out waiting for the import job to finish. Check the table in a few minutes.

Either way the import UI shows it as a failed import. A user who retries then loads the same data a second time. For a CSV with no primary-key column, Harper generates new ids, so the retry duplicates rows. waitForJob's own comment already names this risk for observer failures: a load Harper completed should never be reported as a failure, because that "invites a duplicating retry".

Ask

When following stops without a terminal job status, report it as outcome unknown, the same way #1897 does for writes with no verdict. Say the import may still be running or may have finished, point to the Jobs tab and the table, and don't suggest retrying. #1938 already refreshes the table on these outcomes.

Raised by the cross-model review of #1938 (an import refreshes the table it wrote to); left out of that PR as pre-existing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    P2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions