When exporting an mbox at the moment, the mbox will contain duplicate
entries for each mail - one for every subscription that the
corresponding mailing list has.
Removing the JOIN for the unused subscription table fixes this bug.
References: https://lists.sr.ht/~emersion/hut-dev/%3CZbI-Edu2vu8NsJ5U%40gmail.com%3E
In case a panic happened, not doing anything will continue to
unwind the stack. Not doing anything is actually better because
that avoids loosing the original panic's stack trace.
Instead of parsing the latest email having a
X-Sourcehut-Patchset-Update header to determine what is the status
of the patchset; this patch changes the behavior so that the
status of the patch is exported and stored in the generated mbox,
then read on import.
This ensures that changing the status of a patchset in the srht UI,
then exporting and importing, keeps the status.
We were checking that the access entry had the required permissions,
but weren't checking that the access entry was for the right user.
Reported-by: Thorben Günther <admin@xenrox.net>
A user can have post permissions for a private list that they cannot
browse. If this happens, the triggerUserEmailWebhooks mutation, which
gets triggered for every incoming email, currently crashes. This, in
turn causes an exception in lists.sr.ht-process in `dispatch_message`,
causing such emails to be never forwarded to list members.
The `emailsByIdLoader` rightfully refuses to load the email, so handle
this by allowing the mutation to return `nil` and return early. It is
arguably more correct to deny user webhooks for emails that are
inaccessible to the user anyways.
The internal mutation is currently only used in one place that does not
use the result, so no further changes are necessary.
Some emails can have a bad encoding, a bad charset, a bad header
field, etc. Skip these so that we can try to return a partial thread.
Ideally we'd return a list of errors alongside the partial thread,
but gqlgen doesn't support this yet.
The "index" argument was not specified for standalone feedback.
Fix this by grabbing the line offset from the feedback_block arg,
instead of using a separate arg.
The "line" variable is first assigned to the line string, then it's
overwritten with the line index. Use a different variable name to
reduce confusion.
They were linking to the Message-Id anchor. When a message contains
multiple feedback blocks, this is incorrect.
Use the feedback key instead.
While at it, remove the now unnecessary "body" param from
display_msg().
Remove the dependency on python-emailthreads, replace it with the
GraphQL API backed by go-emailthreads.
The template remains untouched on purpose to make this easier to
review.
Use `me.lists()` and `me.list(name)` instead.
Also remove the now unused loader MailingListsByName. It was returning
incorrect permissions in some cases.
This should go through a `User` object. Instead of
query {
mailingListByOwner(username, listname) {
...
}
}
one should use
query {
user(username) {
list(listname) {
...
}
}
}