fix(kapitalbank-uz): replace jimp with image-js to fix ZodSymbol crash#996
Open
tolmachevmaxim wants to merge 2 commits into
Open
Conversation
jimp v1.x depends on @jimp/types which depends on zod@^3.23.8. Zod uses ES6 Symbol (ZodSymbol) internally which causes a crash in ZenMoney's Android plugin sandbox environment: TypeError: Cannot read properties of undefined (reading 'ZodSymbol') image-js provides the same resize functionality without any zod dependency. The image-js API was already present as commented-out code, confirming this was the intended fallback. Fixes zenmoney#883
Author
Additional contextRoot cause confirmed: Why
Local test passed: Community context (from @zenmoneychat Telegram):
Happy to test on a real Android device once the PR is reviewed. |
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.
Problem
Users cannot sync Kapital Bank Uzbekistan — the plugin crashes immediately with:
Fixes #883
Root Cause
jimp v1.x→@jimp/types→zod@^3.23.8Zod uses
Symbolinternally (ZodSymbol). The ZenMoney Android plugin sandbox does not support this Symbol initialization, causing the crash on plugin load — before any bank communication even happens.Fix
Replace
jimpwithimage-js, which provides identical resize functionality with no zod dependency.The
image-jsAPI was already present as commented-out code inindex.js, confirming this was the originally considered approach:Changes
package.json:jimp ^1.6.0→image-js ^1.5.0src/plugins/kapitalbank-uz/index.js: activate the commentedimage-jspath, remove jimp usage