Forked Workflows call didComplete() early
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- swift
- Domain
- mobile-dev
Research direction
Start with the provided test_workflowForkCompletionOrder example and trace the Workflow fork and commit behavior around didComplete(). Confirm that completion is deferred until all forked branches finish, then run this test and verify the complete, fork, and error call-count assertions.
Written by the indexing model from the issue text.
Description
Original issue: https://github.com/uber/RIBs/issues/216
When forking a
WorkflowthedidComplete()is called as soon as the first branch completes. The fix that addeddidCompleteIfNotYet()guarantees thatdidComplete()is called only once, but that one time is when the first branch completes. Intuitively, I would expect thedidComplete()to be called once all of the branches have completed, but that could be a bad assumption.Related to #211 and the fix in #214
Example Test Case:
func test_workflowForkCompletionOrder() { let workflow = TestWorkflow() let emptyObservable = Observable.just(((), ())) _ = workflow .onStep { _ -> Observable<((), ())> in return emptyObservable } .onStep { _, _ -> Observable<((), ())> in let forkedStep: Step<(), (), ()>? = emptyObservable.fork(workflow) forkedStep? .onStep { _, _ -> Observable<((), ())> in XCTAssertEqual(0, workflow.completeCallCount) return emptyObservable } .commit() return emptyObservable } .onStep { _, _ -> Observable<((), ())> in XCTAssertEqual(0, workflow.completeCallCount) // XCTAssertEqual failed: ("0") is not equal to ("1") return emptyObservable } .commit() .subscribe(()) XCTAssertEqual(1, workflow.completeCallCount) XCTAssertEqual(1, workflow.forkCallCount) XCTAssertEqual(0, workflow.errorCallCount) }
- Dominant language
- Swift
- Stars
- 193
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uber/RIBs-iOS
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·