capacitor-community / capacitor-community/electron

Pointer lost from Web to Native

Open
#197 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
398
Forks
63
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I want to fill an Uint8Array from a Native Node Module, without Coping Data (share the resource). With plane Electron, I can share the Pointer from the Array to the native code and write directly in it. I tried the same Implementation with electron & capacitor, but the Array stays empty.

**To Reproduce**
Steps to reproduce the behaviour:

- Allocate Uint8Array
- call capacitor function with the Array as Parameter
- > function change array data in native code/module, no return value
- check if data is changed on the Web.

**Expected behaviour**
I want to be able to access the same Variables as the Frontend does.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: MacOS
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
I see an IPC call happening. I guess this is the Copy step. Is there a way to run everything in the same Thread? (stay in the Electron render thread)

Contributor guide

Open the contributing guide

Research direction

Start with the reported reproduction: allocate a Uint8Array, pass it through the Capacitor function, and inspect the IPC call that occurs before the native code changes it. Determine whether the Electron platform supports shared memory across this boundary; completion should either demonstrate preserved array data or clearly document the limitation and supported alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.