margelo / margelo/react-native-nitro-fetch
Prefetch TTL validation can crash Swift and does not consistently disable zero-TTL hits
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 997
- Forks
- 50
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 14
Description
The JS builders accept NaN and Infinity, and Swift request/prefetch paths convert prefetchCacheTtlMs directly to Int64, which traps for non-finite or out-of-range values. Both caches also allow a zero TTL to hit when elapsed milliseconds is zero despite the documented <=0 disables cache hits contract. I plan to validate finite JS TTL inputs, avoid trapping native conversions, use monotonic elapsed time, and enforce <=0 cache misses. Ordinary finite TTLs and shared pending requests remain supported.
Contributor 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.
Research direction
Inspect the JS builders and the Swift request and prefetch paths that handle prefetchCacheTtlMs. Check how non-finite and out-of-range values are converted, how elapsed time is measured, and how zero-TTL entries are considered hits. Done means invalid inputs cannot trap, zero-TTL hits are disabled, and ordinary finite TTLs and shared pending requests still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native, swift
- Domain
- api, mobile, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100