Closed Bug 1634127 Opened 4 years ago Closed 2 years ago

Remove the file path behavior from RemoteSetting's download() method

Categories

(Firefox :: Remote Settings Client, task)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: robwu, Assigned: leplatrem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The current implementation of download() of RemoteSettings downloads has several issues:

  • If the record is lost, the downloaded file will linger in the user's profile directory.
  • It does not support use cases where the API client wants to preserve the metadata and attachment content past the lifetime of the record in the collection.
  • Every API client is either encouraged to use the download() with path semantics, or use downloadAsBytes and roll their own storage mechanism.

A replacement was introduced in bug 1620621, in:

I renamed the current method to downloadToDisk and introduced a new download method with extra parameters. The input parameters are backwards-compatible. For backwards-compatibility, the new method calls downloadToDisk unless a new option useCache:true is passed.
The only difference are their return types: downloadToDisk returns a file path, whereas the new download returns an object with the attachment content in an ArrayBuffer, together with its associated record.

If all callers are updated to work with the new behavior, then the old downloadToDisk method can be removed.

See Also: → 1717068
Assignee: nobody → mathieu
Status: NEW → ASSIGNED
Attachment #9269261 - Attachment description: WIP: Bug 1634127 - Download attachments in IndexedDB by default → Bug 1634127 - Download attachments in IndexedDB by default r?robwu
Blocks: 1761473
See Also: → 1763626
Pushed by mleplatre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c43b947f03b0
Download attachments in IndexedDB by default r=necko-reviewers,robwu,dragana

Backed out changeset c43b947f03b0 (Bug 1634127) for causing newtab failures.
Backout link
Push with failures
Failure Log

Flags: needinfo?(mathieu)
Pushed by mleplatre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e1b7056e7529
Download attachments in IndexedDB by default r=necko-reviewers,robwu,dragana
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Flags: needinfo?(mathieu)
See Also: → 1795710
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: