Fetch problem on iOS 17 simulator
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ios, javascript, swift
- Domain
- mobile-dev
Research direction
Reproduce the fetchTest handler from runner.js on the iOS 17 simulator and inspect CapacitorBackgroundRunner/BackgroundRunner.swift around line 160. Trace the returnObj.toDictionary() call and identify why the fetch result reaches an implicitly unwrapped nil. Done means the handler completes without the reported crash while resolving or rejecting the request.
Written by the indexing model from the issue text.
Description
I got the following error on iOS simulator:
CapacitorBackgroundRunner/BackgroundRunner.swift:160: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
The problematic code is this:
returnObj.toDictionary().forEach { key, value in. // Line 160
dict[String(describing: key)] = value
}
My code in the runner.js file:
addEventListener("fetchTest", async (resolve, reject, args) => {
try {
const res = await fetch("https://randomuser.me/api/");
console.log("res???", res);
resolve('plain text');
} catch (err) {
console.error(err);
reject(err);
}
});
- Dominant language
- C
- Stars
- 57
- Forks
- 37
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ionic-team/capacitor-background-runner
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
ionic-team/capacitor-background-runner#158 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ionic-team/capacitor-background-runner#155 · 1 reaction ·
-
Capacitor keeps running old background runnersMay be free again @theproducer claimed this 245 days ago, and no pull request is open. Openbug
ionic-team/capacitor-background-runner#152 · 1 comment · 2 reactions · 1 assignee ·
All issues in ionic-team/capacitor-background-runner
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
python-pillow/Pillow#10087 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenPrinting/cups#1729 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
awslabs/amazon-kinesis-video-streams-webrtc-sdk-c#2406 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
DaveGamble/cJSON#1094 ·
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
PX4/PX4-Autopilot#28923 ·
Maintainers usually reply within 1 day