margelo / margelo/react-native-nitro-fetch

Prefetch TTL validation can crash Swift and does not consistently disable zero-TTL hits

Open
#196 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.