Open Bug 1687305 Opened 4 years ago

Investigate there can be no result for state in ReadRequest

Categories

(Core :: Storage: Cache API, task)

task

Tracking

()

People

(Reporter: tt, Unassigned)

References

Details

We found state can be a nullptr here
https://searchfox.org/mozilla-central/rev/dac45cc7020dfddbcc937827810dd11550c07dc3/dom/cache/DBSchema.cpp#2272 because it's possible that there is no result for the statement.

We should investigate the reason for that. If that's reasonable, we should consider changing the returning type for ReadRequest to Result<Maybe<SavedRequest>, nsresult>. If it's because of database corruption, we should consider returning NS_ERROR_FILE_CORRECPTED while state is a nullptr if it's because of database corruptions.

We should have a test to ensure the behavior.

Note in bug 1684838, we return NS_ERROR_UNEXPECTED if state is a nullptr.

You need to log in before you can comment on or make changes to this bug.