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

fix(load_json): use int action id #483

Merged
merged 1 commit into from
Jan 10, 2024
Merged

fix(load_json): use int action id #483

merged 1 commit into from
Jan 10, 2024

Conversation

nkpz
Copy link

@nkpz nkpz commented Nov 10, 2023

When a story is loaded from JSON, it currently does not convert the action IDs to ints. It looks like Kobold prevents this from causing issues by refreshing the page, but in Ghostpad I've noticed catastrophic bugs resulting from it.

First a story is loaded and string-based IDs get loaded in state

Screenshot 2023-11-10 at 04 49 45

Then as the story is edited, it (correctly) stores those changes using int based IDs
Screenshot 2023-11-10 at 04 48 25

And that's where things get very broken.

This PR makes two small changes to load_json:

  1. Store the int based action id in a variable called action_id so we don't have to cast it 4+ times
  2. Use the int based action id in the data that gets sent to process_variable_changes

I could work around this on the frontend, but I think it makes more sense to have consistent types being sent over the socket

Copy link

@FunkEngine2023 FunkEngine2023 left a comment

Choose a reason for hiding this comment

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

Surgical precision.

@henk717 henk717 merged commit b9dace6 into henk717:united Jan 10, 2024
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.

3 participants