Remove the file path behavior from RemoteSetting's download() method
Categories
(Firefox :: Remote Settings Client, task)
Tracking
()
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 usedownloadAsBytes
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.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Backed out changeset c43b947f03b0 (Bug 1634127) for causing newtab failures.
Backout link
Push with failures
Failure Log
Comment 5•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Description
•