ampproject / ampproject/amp-sw

AmpDocumentNetworkFirst.makeRequest return is not nullable but method body implies that it might be nullable

Open
#47 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
70
Forks
22
PR merge metrics
No merged PRs in 30d

Description

inside the body of `makeRequest` in the `AmpDocumentNetworkFirst` class there is a check for `request` where it could be nullable but we return `request` anyways as the base case and don't state it in the method signature return type.

question really is, does calling `makeRequest` return something that is nullable from the `NetworkFirst` implementation in workbox?

Contributor guide

Open the contributing guide

Research direction

Start by reading AmpDocumentNetworkFirst.makeRequest and tracing the corresponding NetworkFirst implementation in Workbox. Compare the possible return value with the declared method signature, then confirm the signature and behavior agree and add or update coverage if the repository provides a relevant test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.