Repository navigation
Conversation
) #46 (ARAD-OGR-005 follow-up): every mount issued its own fetch with no abort, so one link shown several times, a re-mounted list or React StrictMode multiplied the requests made against the API key from each visitor's browser. - requestResults shares one request between cards asking for the same URL and reuses a successful answer for 60 seconds. Error responses and failed requests are not remembered. forceCacheUpdate always asks again. - A request is aborted once no mounted card is waiting for it, and a card no longer updates state after it unmounts. #47 (ARAD-OGR-011 follow-up): the published bundle had no source map. - webpack emits build/index.js.map, which the files allowlist already ships. - Version 2.5.1, to be published by CI from a v2.5.1 tag so the release carries provenance (2.5.0 was published by hand). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #46 (ARAD-OGR-005) and #47 (ARAD-OGR-011), the two retest follow-ups for this package.
#46: requests made from each visitor's browser
The README warning and
proxyUrlmode were already done. What the retest left open: the component fetched on every mount, with no abort, no sharing and no reuse. In direct mode each of those requests spends the site's API key.src/util/requestResults.js. Cards asking for the same URL share one request, and a successful answer is reused for 60 seconds. Error responses and failed requests are not remembered.forceCacheUpdatealways makes a new request.Not changed: direct mode still sends
app_idin the URL. That is the documented design, and removing it would break every existing user;proxyUrlis the way to keep the key off the page.#47: the published bundle
CI,
prepublishOnly, thefilesallowlist andnpm publish --provenancealready exist. Two things were open:webpack.config.jsnow setsdevtool: 'source-map';build/index.js.mapships (checked withnpm pack --dry-run).gitHeadis not on GitHub and npm shows no attestation. This PR sets the version to 2.5.1.After merge (needs a person)
v2.5.1and push the tag. CI publishes it with provenance.npm view opengraph-react@2.5.1 dist.attestationsis not empty.npm deprecate opengraph-react@2.5.0 "Published without provenance; use 2.5.1".Behaviour change to know about
A card mounted within 60 seconds of an identical one shows the earlier answer instead of fetching again. Pass
forceCacheUpdatewhere a fresh fetch on every mount is wanted.Testing
npm test: 32 passing (8 new). With the oldsrc/index.jsrestored, 6 of the new tests fail.forceCacheUpdaterefetches; the request is aborted when its only card unmounts and kept while another card waits; errors are not remembered; no update after unmount.npm run buildsucceeds and emitsindex.jsandindex.js.map.🤖 Generated with Claude Code