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

Bug: Panic when creating a thing named "Journal" #327

Open
MikkelPaulson opened this issue Sep 21, 2023 · 3 comments
Open

Bug: Panic when creating a thing named "Journal" #327

MikkelPaulson opened this issue Sep 21, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@MikkelPaulson
Copy link
Collaborator

MikkelPaulson commented Sep 21, 2023

Steps to reproduce:

  1. Open the web inspector it your browser.
  2. Type npc named journal.
  3. Press j.
  4. Bask in the error message panicked at 'internal error: entered unreachable code', core/src/storage/command.rs:367:30

The unreachable!() code should actually be unreachable - the problem is that the parse_input on line 352 is returning multiple results and the if let block is choosing the canonical StorageCommand::Journal result rather than the fuzzy StorageCommand::Load { .. } result, which is what we're actually concerned with at that point.

@MikkelPaulson MikkelPaulson added the bug Something isn't working label Sep 21, 2023
@MikkelPaulson
Copy link
Collaborator Author

@alfonsomartinezs If you're interested, this might help to your understanding of the nuances of command parsing.

@ThinkerDreamer
Copy link

After some experimentation with this in the browser, I discovered that after creating an NPC named "Journal", you can actually call your journal if you've already used the command, by pressing up and then enter. It's typing "j" in the box that causes the panic.

@MikkelPaulson
Copy link
Collaborator Author

MikkelPaulson commented Aug 15, 2024

Correct, the panic is in the autocomplete code, not the command parsing. Those are unfortunately two completely different code blocks that do effectively the same thing by way of incomplete vs. complete parsing (#104). Accessing it through the command history will bypass the autocomplete code altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants