fix: compare v:shell_error to number 0 instead of string '0' for enterprise version fetch#518
Open
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
In commit 9ff8d32, the enterprise version fetch condition was changed from 'if v:shell_error' to 'if v:shell_error == "0"', comparing against a string instead of a number. While Vim's type coercion makes this work in legacy script, it's inconsistent with every other v:shell_error check in the codebase (lines 42, 54, 66) which all compare to the number 0. Fix by using the correct numeric comparison. Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Author
Original prompt from Mokshit
|
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Fixes a type comparison bug in the enterprise version fetching logic in
autoload/codeium/server.vim.In commit 9ff8d32, the condition
if v:shell_error(which was inverted — entering the success branch on failure) was changed toif v:shell_error == '0'. While this fixed the logic direction, it compares against the string'0'instead of the number0.v:shell_erroris a Vim Number type. Every otherv:shell_errorcheck in this file (lines 42, 54, 66) and across the codebase correctly compares to the number0. This fix aligns the enterprise version fetch condition with the rest of the codebase.Review & Testing Checklist for Human
portal_urlconfigured (not matching.windsurf.comordstart.com) can still fetch the version from their portal's/api/versionendpointNotes
While Vim's legacy script type coercion means
0 == '0'evaluates to true (so this likely worked in practice), the string comparison is inconsistent and could cause issues in Vim9 script or confuse future contributors.Link to Devin session: https://localhost:3000/sessions/d2808c12089f43bba7d6f5cbad1fd923
Requested by: @Mokshit06