Closed Bug 1928092 Opened 11 days ago Closed 26 minutes ago

QM: Temporary origin is not added to cached origins if directory metadata creation fails

Categories

(Core :: Storage: Quota Manager, defect, P2)

defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

https://searchfox.org/mozilla-central/rev/5fdbe0d78d61581aa4b37ce82bbf31c2bd7826f1/dom/quota/ActorsParent.cpp#6077-6096

    QM_TRY_INSPECT(const bool& created, EnsureOriginDirectory(*directory));

    if (created) {
      const int64_t timestamp = PR_Now();

      // Only creating .metadata-v2 to reduce IO.
      QM_TRY(MOZ_TO_RESULT(CreateDirectoryMetadata2(*directory, timestamp,
                                                    /* aPersisted */ false,
                                                    aOriginMetadata)));

      FullOriginMetadata fullOriginMetadata =
          FullOriginMetadata{aOriginMetadata,
                             /* aPersisted */ false, timestamp};

      AddTemporaryOrigin(fullOriginMetadata);

      // Don't need to traverse the directory, since it's empty.
      InitQuotaForOrigin(fullOriginMetadata, ClientUsageArray(),
                         /* aUsageBytes */ 0);
    }

AddTemporaryOrigin should be called before CreateDirectoryMetadata2.

Blocks: 1671932
Depends on: 1927723
Blocks: 1929190
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fe6b17b10f75 QM: Add a new artificial failure for CreateDirectoryMetadata2; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/a2adddbb10d9 QM: Add a disabled test for a failure during temporary origin initialization; r=dom-storage-reviewers,asuth https://hg.mozilla.org/integration/autoland/rev/6e6ecf3fc853 QM: Add temporary origin to cached origins even if directory metadata creation fails; r=dom-storage-reviewers,asuth
Status: ASSIGNED → RESOLVED
Closed: 26 minutes ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: