Map () to nil when converting callback results - #88
Merged
CaitlynMainer merged 1 commit intoAug 27, 2026
Conversation
Whenever a callback wants to return a `nil` value, it has to pass either `null` or `None` to the `result` function (in fact, previously all the code used `null` exclusively). But I guess the vibeport really wanted to follow Scala conventions because it replaced these nulls with `()` in a lot of places, which the Registry did not handle explicitly, falling back to stringifying it during the conversion. As a result, a bunch of methods returned `"()", errorMessage` where before it would've been `nil, errorMessage`. This commit adds an explicit case for `()` in the conversion routine so that `()` gets mapped to `nil`, fixing all of these methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To return
nilfrom a component@Callback, it has to pass eithernullorNoneto theresultfunction, though previously all callbacks usednullexclusively. The vibeport apparently didn't get the memo, so in its misguided attempt to stick to Scala conventions it replaced a bunch of thesenulls with().Now,
()is neithernullnorNone, so theRegistrydid not map it tonil. In fact, theRegistrydidn't have an explicitcasefor it at all, so it defaulted to converting it to string. As a result, all those methods that the vibefork tampered with started returning"()", errorMessageinstead ofnil, errorMessage.This PR fixes this by adding
()to the list of values that representnil(meaning now you can use eithernull,None, or()). However, the code remains inconsistent, as half the calls uses()and the other half keeps passingnull. It might be a good idea to commit to either choice: replace()withnullor vice versa. (I prefer()personally, FWIW.)