Skip to content

Conversation

manshusainishab
Copy link

fixes: #5368

fixed the type error for the initialTransitionObject added the required "eventType" support.

Copy link

changeset-bot bot commented Oct 4, 2025

⚠️ No Changeset found

Latest commit: 87163d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@manshusainishab
Copy link
Author

hey @davidkpiano , if you have any comments over this you can ping me to update or we can proceed with the merge.

Comment on lines +97 to +109
// 🔧 Patch non-string eventType fields
function fixEventTypes(obj: any) {
if (Array.isArray(obj)) {
obj.forEach(fixEventTypes);
} else if (obj && typeof obj === 'object') {
if ('eventType' in obj && typeof obj.eventType !== 'string') {
obj.eventType = String(obj.eventType);
}
Object.values(obj).forEach(fixEventTypes);
}
}

fixEventTypes(json);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this code should be here. If .eventType is missing somewhere then please include it in the core of the library - not patch it up in a test file (and in a completely wrong way, from what I can tell).

Copy link
Author

Choose a reason for hiding this comment

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

hey @Andarist , can you once go through all the changes I have made I think then you can get the reason of converting the nested eventType into string for test case so it passes the validate function even then you have some more better approach I would be happy to implement just drop it in thread. 😊

Copy link
Collaborator

Choose a reason for hiding this comment

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

In a way, this reverts part of #5380 . I'm not sure if that change was good or not but based on this PR alone I have no idea how to assess what you are after here. Please provide a full e2e test/description of what happens right now and how things go in your way.

Stringifying an arbitrary value and assigning it back to an object in this test code is definitely not a solution to any problem.

Perhaps you have a gripe with this thing here?

eventType: null as any,

But even if that's the case, I still don't fully understand your problem so it would be great if you could describe it in full detail. Note that initial transitions shouldn't have a required eventType property at all because they can be taken in response to just any event accepted by a machine. There is no singular event type that could be assigned to this property

Copy link
Author

@manshusainishab manshusainishab Oct 7, 2025

Choose a reason for hiding this comment

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

Screenshot 2025-10-07 at 7 08 05 PM

I followed his instructions while solving the issue @Andarist

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: initialTransitionObject schema requires eventType but does not define it in properties

3 participants