bug.attachments shouldn't include attachment data by default

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
Extensions: BzAPI Compatibility
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: kohei, Assigned: glob)

Tracking

Production

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
+++ 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
(Reporter)

Comment 1

4 years ago
ping?

Updated

4 years ago
Depends on: 880669
(Assignee)

Updated

4 years ago
Assignee: nobody → glob
(Assignee)

Comment 2

4 years ago
Created attachment 8452399 [details] [diff] [review]
1029500_1.patch
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+
(Assignee)

Comment 4

4 years ago
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.