inkle / inkle/ink

Externals, once validated, never need revalidated?

Open
#750 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

I'm in the process of making a port of the Ink Runtime Engine, so of course I'm basically auditing the code for everything while I'm figuring out how to port it. I'm in the last stages, porting the insanely long Story class, and I noticed something really odd:

https://github.com/inkle/ink/blob/e10a231eecd94f9155e9cf527e3712a6b43e9083/ink-engine-runtime/Story.cs#L2221-L2231

The _hasValidatedExternals internal variable is never set to false anywhere in the code base. In fact, it's set to true twice in a row in the snippet of code linked above. This seems like a bug, because _hasValidatedExternals *either* means that validation of external bindings has occurred *or* that said validation was successful, and this code seems to imply it means *both?* And I would think in *either* case, this variable should be getting set to false in `BindExternalFunctionBase`, to indicate that it needs to re-validate the external bindings. But it doesn't.

I imagine this is usually not a problem because the most common use case will bind functions on initialization of the game and never need to create additional bindings or change existing ones. Still seems like a bug, though, so I wanted to write it up here for future reference (and so I can reference something when my port deviates from upstream to fix this).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.