Bug#910360: debbugs: get_bug_log SOAP operation truncates message
On Wed, 10 Oct 2018, Michael Albinus wrote:
> Since it returns just empty 'attachments' as of today, and it isn't
> specified anywhere what shall be in, it makes sense.
>
> > 2) MIME messages are much more complicated than just a list of
> > attachments; there could be additional messages with more attachments
> > within them
>
> Yes, although such nested attachments are rather rare in bug
> communication I guess.
The usual case where they exist is in forwarded messages or in the cases
where the BTS includes the original message as an attachment when the
bug is closed.
> Good idea. Shall I raise a (wishlist) bug report about?
There's a wishlist bug for it right now: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712979
On Thu, 11 Oct 2018, Michael Albinus wrote:
> The most simple way would be to handle any attachment like a message.
> 'header' would be the two lines 'Content-Type' and
> 'Content-Transfer-Encoding'. Every attachment would get a unique
> message number, like the messages themselves. 'get_bug_log' shall
> support the second argument $msg_num (which is still could be
> optional), in order to retrieve the bodies of attachments.
> Alternatively, we could have a structure in the attachments with just
> 'header' and 'msg_num', like
>
> --8<---------------cut here---------------start------------->8---
> [{header => '...',
> body => '...',
> attachments => [{header => '...',
> msg_num => 11,
> },
> header => '...',
> msg_num => 15,
> },
> {header => '...',
> msg_num => 20,
> },
> ],
> msg_num => 5,
> },
> {header => '...',
> body => '...',
> attachments => [],
> msg_num => 8,
> },
> ]
> --8<---------------cut here---------------end--------------->8---
I like this approach better, but I'd suggest that we do something like:
attachments => [{attachment_id => 1,
content_type => 'text/plain',
content_name => 'if defined',
# or whatever the right mime headers are; I forget
},]
and then another SOAP interface which does something like:
get_bug_attachment($bug_num,$msg_num,$attachment_id)
Another option could be for the SOAP call just to return the entire
message without doing any MIME parsing; maybe that would be better?
--
Don Armstrong https://www.donarmstrong.com
unbeingdead isn't beingalive
-- e.e. cummings "31" _73 Poems_
Reply to: