Comments (7)
This issue has been labeled as type: bug
. This label is added to issues that that have been reproduced and are being tracked in our internal issue tracker.
from capacitor.
please, provide a sample app that reproduces the issue, not a full app with no indications about how to run or reproduce
from capacitor.
Here you go: https://github.com/marcelklehr/capactitor-repro-fetch-uint8array
from capacitor.
Is there any ETA on this issue? 🙏
from capacitor.
This is how it works from my understanding:
- for android or web: the convertBody function detects the type
capacitor/core/native-bridge.ts
Line 767 in 0ad0c3f
- the type detection is based on the content type. The integer value is treat as a text since no content-type was specified here:
capacitor/core/native-bridge.ts
Line 91 in 0ad0c3f
- the function request is called
- this is the android implementation of request:
- the capacitorhttp class calls HttpRequestHandler request method which gets the datatype and data
- calls setRequestBody
- The last case should convert the raw data into string because it does not know how to handle it:
- Even if the type is recognized as json: the text is converted to string which treats integer as a string.
From this analysis, all platforms should be affected by this bug since the convertBody function is shared by ios, android and web.
In my opinion, the solution depends on the body type:
- if the body is a integer, the convertbody function should detect that the value is an integer. The platform implementation should handle integer values as well.
- if the body is a json, we should use json.Stringify instead of the common toString method in the platform implementation side.
In both cases, a new function is needed to write mixed data (string+integer) to the outputstream (like writeRequestBody does for string).
Please correct me if I said something wrong. I hope this might help to solve this issue.
from capacitor.
I'm facing with uploading images on Android on capacitor 6, the same code was working well on Capacitor 5. iOS is working okay, but I'm getting java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
on Android
from capacitor.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
from capacitor.
Related Issues (20)
- [Android Studio]Unable to delete directory HOT 2
- [Bug]: Failed to load service worker when build app HOT 2
- [Feature]: Persist storage (IndexedDB etc.) HOT 2
- [Bug]: capacitorHttp cause ios App crash HOT 2
- [Bug]: Capacitor on Android detected as web platform when server.url contains fragment on WebViews that support DOCUMENT_START_SCRIPT HOT 2
- [Bug]: @capacitor/google-maps tagged V6 has unmet peer dependency with V6, forcing install doesn't work on Android HOT 3
- [Feature]: update push notification icon programatically HOT 3
- [Bug]: With an nx.json config, `npx cap sync` hooks (capacitor:sync:before and capacitor:sync:after) are executing from the node_modules instead of the repo root HOT 1
- [Bug]: all plugins is not implemented on android HOT 3
- [Feature]: Proposed documentation improvement HOT 2
- [Bug]: Smooth switching between native keyboard and emoji picker HOT 3
- [Feature]: BridgeFragment supports creating plugins?only support activity? HOT 3
- [Bug]: cap camera unable to build the project HOT 2
- [Bug]: Android signed build crashes (Ionic) HOT 1
- [Bug]: Geolocation.watchPosition() almost always call the callback passed to it two times instantly HOT 3
- [Bug]: pinch zoom not working on ios with capacitor v6 HOT 2
- [Bug]: Image is clipped when data url is generated from canvas - Android/iOS
- [Bug]: Native bridge uses an api unsupported by older versions of Android WebView HOT 4
- [Bug]: Boundary is not extracted correctly from multipart/form-data requests when using CapacitorHttp HOT 3
- [Bug]: iOS version 17.5 on the iPhone 15 pro Emulator WebGL Unsupported HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor.