Closed Bug 1684912 Opened 5 years ago Closed 5 years ago

The caller of CreateStorageConnection needs to know if the usage file was removed even if the method failed

Categories

(Core :: Storage: localStorage & sessionStorage, defect, P2)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox84 --- unaffected
firefox85 --- disabled
firefox86 --- fixed

People

(Reporter: janv, Assigned: sg)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

This is a regression that was introduced by changes done in bug 1671367.

The call at https://searchfox.org/mozilla-central/rev/f8a41209af503016e78278774052d48d8c52b91c/dom/localstorage/ActorsParent.cpp#7395 no longer sets rv and LS_TRY_INSPECT immediately returns if there was an error, so the check below doesn't have a chance to update the quota object.

Assignee: nobody → sgiesecke

We could either change the return type of CreateStorageConnection to std::pair<Result<nsCOMPtr<mozIStorageConnection>, nsresult>, bool> (with the bool indicating whether the usage file was removed), or add a functor argument that is called by CreateStorageConnection in case it removes the usage file and change the return type to simply Result<nsCOMPtr<mozIStorageConnection>, nsresult>. Without having checked feasibility, I have a slight preference for the latter option.

Yes, I would prefer the latter as well.

The handler is called before opening the connection again. This does not restore
the behaviour before Bug 1684912 exactly. In case removal of the usage or database
file fails, the handler will not be called. Also, if the handler fails, the database
will not be attempted to be recreated.

Set release status flags based on info from the regressing bug 1671367

Is this something we can live with for 85, is the fix going to be ready for uplift this week, or are we better off reverting the regressing change?

Flags: needinfo?(sgiesecke)

(In reply to Julien Cristau [:jcristau] from comment #6)

Is this something we can live with for 85, is the fix going to be ready for uplift this week, or are we better off reverting the regressing change?

The affected behaviour is enabled only in Nightly, so we can live with the unpatched version riding to 85.

Flags: needinfo?(sgiesecke)
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1cc2386869a3 Call a handler in case a corrupted database file was detected. r=dom-workers-and-storage-reviewers,janv
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: