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

Lib.fold crashes in the script editor #378

Open
guyguy2001 opened this issue Jun 9, 2024 · 0 comments
Open

Lib.fold crashes in the script editor #378

guyguy2001 opened this issue Jun 9, 2024 · 0 comments
Labels
pending triage type: bug Something isn't working

Comments

@guyguy2001
Copy link
Contributor

guyguy2001 commented Jun 9, 2024

Expected Behavior

Woah there are different sections build in here... cool

Lib.fold should work both in the script editor, and in boosters, like how it did in the old site.

Alternatively, it should be documented to not work, and raise an indicative error, such as "Scripts trying to fold sequences don't work anymore" (so that old etc. scripts which were based on Lib.fold would get a clear deprecation error)

Current Behavior

I get the following result in firefox:

Return : document.getElementById(...) is null
Evaluation time : 0 sec

And in chrome:

Return : Cannot read properties of null (reading 'fold')
Evaluation time : 0.001 sec

and no errors in the console

Reproduction Steps

Run https://eternagame.org/scripts/13522515

Environment

Firefox 126.0.1 (64-bit)
Chrome 125.0.6422.142 (Official Build) (64-bit) (cohort: Stable)
Windows 11 Version 23H2 (Build 22631.3672)

Other information

No response

@guyguy2001 guyguy2001 added type: bug Something isn't working pending triage labels Jun 9, 2024
luxaritas pushed a commit to eternagame/EternaJS that referenced this issue Dec 20, 2024
## Summary
This is part of the process of extracting the script-facing API from
PoseEditMode in order to make it usable for non-booster scripts.
Replaces #749

## Implementation Notes
I did it like the previous PR, except I didn't implement
get_folder/select_folder, since they are behind a "lock", and I didn't
want to think yet of whether or not I want the extracted logic to
inherit the lock.
However, while get_folder is locked, the calculation functions (such as
`fold`) which also access the folder, aren't locked (even on `dev`). Is
this intended?

## Testing
I ran https://eternagame.org/scripts/13774466, and it passed.
The script checks that all of the extracted functions (expect folding
with binding sites) work and return the same values.

This is an unrelated issue, but : For some reason, both on main/master
(https://eternagame.org/puzzles/6096060/play) and on my branch, the
first time I run it I get the following errors, and on future runs it
passes. Reloading the page makes the issue appear again for a single
execution.
Errors:

![image](https://github.com/user-attachments/assets/1fca8f90-85f4-485c-9ff4-a44fcdb2445a)
Successful run:

![image](https://github.com/user-attachments/assets/ecfe8020-2724-44f3-819f-0a6c13182786)
(In my branch I just copy pasted the script, since I didn't have it on
eternadev.org, and changed `Lib.fold`->`applet.fold`. I shouldn't have
Lib in the terminal, right?)


## Related Issues
Enables eternagame/eternagame.org#378,
#750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending triage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant