Skip to content
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

Set deepest nested service to current #231

Merged
merged 4 commits into from
Dec 27, 2024
Merged

Set deepest nested service to current #231

merged 4 commits into from
Dec 27, 2024

Conversation

matthewp
Copy link
Owner

This makes it so that we always use the deepest nested service as the current.

This is not a breaking change as this is current expected behavior. We were passing service.child to be the new current, but not accounting for the possibility of deeply nested machines.

Fixes #195

This makes it so that we always use the deepest nested service as the `current`.

This is not a breaking change as this is current expected behavior. We were passing `service.child` to be the new current, but not accounting for the possibility of deeply nested machines.

Fixes #195
Copy link

changeset-bot bot commented Dec 27, 2024

🦋 Changeset detected

Latest commit: 20e68d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
robot-hooks Patch
robot3 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@matthewp matthewp requested a review from ehuelsmann December 27, 2024 18:12
@@ -359,7 +359,7 @@ QUnit.module('Invoke', hooks => {

QUnit.test('Invoking a machine that immediately finishes', async assert => {
assert.expect(3);
const expectations = [ 'two', 'nestedTwo', 'three' ];
const expectations = [ 'nestedTwo', 'three', 'three' ];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that this is the expected behaviour. For the next breaking (major) release, I'd say that it makes a lot of sense to have const expectations = [ 'two.nestedTwo', 'three', 'three' ]; because it aligns with the recently added .matches() API.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we collect these somewhere?

Copy link
Collaborator

@ehuelsmann ehuelsmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@matthewp matthewp merged commit 9fbdbcb into main Dec 27, 2024
2 checks passed
@matthewp matthewp deleted the set-current branch December 27, 2024 19:52
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.

[bug?] Nested machines immediate issue
2 participants