Skip to content

Commit 35e2b2c

Browse files
Testclaude
andcommitted
fix(installer): remove nsJSON intermediate error checks causing false positives
Root cause: nsJSON operations set the NSIS error flag even when succeeding. The CI tests explicitly note "Don't check intermediate errors" and this fix aligns the installer with the proven CI test pattern. Changes: - Remove ClearErrors + ${If} ${Errors} checks after each nsJSON::Set call - Use backticks for key names (matching CI syntax) - Use lowercase /value without /END (matching CI syntax) - Only validate final nsJSON::Serialize result 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7bad6d3 commit 35e2b2c

2 files changed

Lines changed: 12 additions & 37 deletions

File tree

scripts/installer/mcpb-installer.nsi

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -415,50 +415,25 @@ Function CreateMCPBConfig
415415
DetailPrint "Created directory: $PROFILE\.mcpb"
416416

417417
; Construct config.json using nsJSON
418-
; CRITICAL: nsJSON requires backticks for literal JSON values, not double quotes
419-
ClearErrors
418+
; CRITICAL: Match CI test pattern - don't check intermediate errors, just verify final result
419+
; nsJSON operations may set error flag even when succeeding (false positives)
420420
nsJSON::Set /value `{}`
421-
${If} ${Errors}
422-
StrCpy $ErrorMessage "Failed to initialize config JSON"
423-
DetailPrint "$ErrorMessage"
424-
SetErrors
425-
Return
426-
${EndIf}
427-
428-
; Set server_url
429-
ClearErrors
430-
nsJSON::Set "server_url" /VALUE `"$ServerUrl"` /END
431-
${If} ${Errors}
432-
StrCpy $ErrorMessage "Failed to set server_url in config"
433-
DetailPrint "$ErrorMessage"
434-
SetErrors
435-
Return
436-
${EndIf}
421+
nsJSON::Set `server_url` /value `"$ServerUrl"`
422+
nsJSON::Set `access_token` /value `"$AccessToken"`
423+
nsJSON::Set `refresh_token` /value `"$RefreshToken"`
437424

438-
; Set access_token
439-
ClearErrors
440-
nsJSON::Set "access_token" /VALUE `"$AccessToken"` /END
441-
${If} ${Errors}
442-
StrCpy $ErrorMessage "Failed to set access_token in config"
443-
DetailPrint "$ErrorMessage"
444-
SetErrors
445-
Return
446-
${EndIf}
425+
; Serialize to JSON string - this is where we verify success
426+
nsJSON::Serialize /PRETTY /UNICODE
427+
Pop $0 ; JSON string
447428

448-
; Set refresh_token
449-
ClearErrors
450-
nsJSON::Set "refresh_token" /VALUE `"$RefreshToken"` /END
451-
${If} ${Errors}
452-
StrCpy $ErrorMessage "Failed to set refresh_token in config"
429+
; Verify we got valid JSON (not empty)
430+
${If} $0 == ""
431+
StrCpy $ErrorMessage "Failed to create config JSON"
453432
DetailPrint "$ErrorMessage"
454433
SetErrors
455434
Return
456435
${EndIf}
457436

458-
; Serialize to JSON string
459-
nsJSON::Serialize /PRETTY /UNICODE
460-
Pop $0 ; JSON string
461-
462437
DetailPrint "Config JSON: $0"
463438

464439
; Write config.json file

src/code_indexer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
HNSW graph indexing (O(log N) complexity).
77
"""
88

9-
__version__ = "8.4.37"
9+
__version__ = "8.4.38"
1010
__author__ = "Seba Battig"

0 commit comments

Comments
 (0)