Skip to content

JobScheduler and Connecting know to expect a job started from firefly - #384

Open
Craiting wants to merge 1 commit into
masterfrom
ct/CT-2495-connecting-stall
Open

JobScheduler and Connecting know to expect a job started from firefly#384
Craiting wants to merge 1 commit into
masterfrom
ct/CT-2495-connecting-stall

Conversation

@Craiting

@Craiting Craiting commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes an issue (CT-2495) where Connect Widget could become stuck indefinitely on the Connecting... screen following an OAuth redirect.

  • Refresh Member on Schedule Init: Loads fresh member data from the API before initializing the job schedule rather than relying on stale post-OAuth Redux state (PENDING, null job GUID).
  • Foreign Job & 409 Recovery: Handles conflicts when Firefly initiates a background job (e.g., aggregation) on redirect:
    • Gracefully catches 409 Conflict rejections when the widget tries to start its scheduled job.
    • Polls until the member is completely idle (is_being_aggregated: false) before attempting to start the scheduled job (crucial for early data release flows).
    • Automatically re-attempts the active job once the foreign job finishes, backed by a MAX_FOREIGN_JOB_RETRIES (5) safeguard to prevent infinite loops.
  • Job Scheduler Deduplication & Preservation: Updated JobSchedule.onJobFinished so that when a foreign job completes, the scheduled ACTIVE job remains active instead of erroneously promoting a pending job or duplicating
    active jobs.
  • Safe Fallbacks for Missing Job Data: Extracted loadMostRecentJob helper to safely handle missing or 404/500 job lookups without terminating the RxJS stream.
  • PostMessage Deduplication: Added a ref guard to ensure the deprecated connect/initialDataReady postMessage event is fired at most once per connection session.

Playwright test suite passing:
image

I ran all the cypress tests locally too and they all passed except the Spanish one and I think that was caused by a different issue.

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

Successfully merging this pull request may close these issues.

1 participant