Closed Bug 1029500 Opened 10 years ago Closed 10 years ago

bug.attachments shouldn't include attachment data by default

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kohei, Assigned: glob)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1027025 +++

I just noticed my BzAPI app downloaded 6 MB of data at startup while testing the compat API. Looks like the compat API's bug method returns attachments with the data and encoding:

https://api-dev.bugzilla.mozilla.org/latest/bug?id=1027037&include_fields=id%2Cattachments
https://bugzilla.mozilla.org/bzapi/bug?id=1027037&include_fields=id%2Cattachments

The extra data won't be a compatibility issue, but to reduce bandwidth, the data shouldn't be returned unless we expressly retrieve it.

https://api-dev.bugzilla.mozilla.org/latest/bug?id=1027037&include_fields=id%2Cattachments&attachmentdata=1
https://api-dev.bugzilla.mozilla.org/latest/bug?id=1027037&include_fields=id%2Cattachments%2Cattachments.data%2Cattachments.encoding

https://wiki.mozilla.org/Bugzilla:REST_API:Methods#Retrieve_attachment_.28.2Fattachment.2F.3Cid.3E_GET.29
ping?
Depends on: 880669
Assignee: nobody → glob
Attached patch 1029500_1.patchSplinter Review
Attachment #8452399 - Flags: review?(dkl)
Comment on attachment 8452399 [details] [diff] [review]
1029500_1.patch

Review of attachment 8452399 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8452399 - Flags: review?(dkl) → review+
it's a shame we have to grab the attachment data from the db only to drop it later, but that's fodder for another bug.

To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   4c9f4e7..3deb100  master -> master
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: Extensions: BzAPI Compatibility → Extensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: