~emersion/soju-dev

5 2

Spurious 403 Responses

Details
Message ID
<87fsyhixrk.fsf@posteo.net>
DKIM signature
pass
Download raw message
Hi,

I just set up Multi upstream mode, and am constantly receiving

  403 Missing network suffix in channel name

messages.

It turns out that my client (rcirc on Emacs) is sending messages with my
username without a network suffix, and this is caught in
unmarshalEntity. I believe that KEEPALIVE messages of this form

        PRIVMSG pkal :KEEPALIVE 1621500884.477356

are the problem. So while I could disable these messages in my client,
it might be worthwhile investigating situations where the error can be
safely suppressed.

-- 
	Philip K.
Details
Message ID
<db7iCEwed6kWl8S3hnyt--KjQJJZS6FZ22mi09PRpBS5H3PR6TWHagIGDhN_wQmAocFhDlkPKTh24tC4FkYT50xHZHL8qHBYtR33b-tRzes=@emersion.fr>
In-Reply-To
<87fsyhixrk.fsf@posteo.net> (view parent)
DKIM signature
pass
Download raw message
On Thursday, May 20th, 2021 at 11:02 AM, Philip Kaludercic <philipk@posteo.net> wrote:

> I just set up Multi upstream mode, and am constantly receiving
>
>   403 Missing network suffix in channel name
>
> messages.
>
> It turns out that my client (rcirc on Emacs) is sending messages with my
> username without a network suffix, and this is caught in
> unmarshalEntity. I believe that KEEPALIVE messages of this form
>
>         PRIVMSG pkal :KEEPALIVE 1621500884.477356
>
> are the problem. So while I could disable these messages in my client,
> it might be worthwhile investigating situations where the error can be
> safely suppressed.

Ah, that's a good point. I didn't know some clients were (ab)using self
messages like this.

We should indeed handle this case in multi-upstream mode, probably by just
echo'ing back the message to the user, like a regular IRC server would do.
Probably around here:

https://git.sr.ht/~emersion/soju/tree/c8a54235d0361732cea04bd7a279e15d20a3deb0/item/downstream.go#L1673

We already have similar special-cases for e.g. WHO/WHOIS:

https://git.sr.ht/~emersion/soju/tree/ec26117c081bbb3406ea04d3ed1bb4f9cec4ab63/item/downstream.go#L1561
Details
Message ID
<87r1hxqi1l.fsf@icterid>
In-Reply-To
<db7iCEwed6kWl8S3hnyt--KjQJJZS6FZ22mi09PRpBS5H3PR6TWHagIGDhN_wQmAocFhDlkPKTh24tC4FkYT50xHZHL8qHBYtR33b-tRzes=@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
Simon Ser <contact@emersion.fr> writes:

> On Thursday, May 20th, 2021 at 11:02 AM, Philip Kaludercic <philipk@posteo.net> wrote:
>
>> I just set up Multi upstream mode, and am constantly receiving
>>
>>   403 Missing network suffix in channel name
>>
>> messages.
>>
>> It turns out that my client (rcirc on Emacs) is sending messages with my
>> username without a network suffix, and this is caught in
>> unmarshalEntity. I believe that KEEPALIVE messages of this form
>>
>>         PRIVMSG pkal :KEEPALIVE 1621500884.477356
>>
>> are the problem. So while I could disable these messages in my client,
>> it might be worthwhile investigating situations where the error can be
>> safely suppressed.
>
> Ah, that's a good point. I didn't know some clients were (ab)using self
> messages like this.
>
> We should indeed handle this case in multi-upstream mode, probably by just
> echo'ing back the message to the user, like a regular IRC server would do.
> Probably around here:
>
> https://git.sr.ht/~emersion/soju/tree/c8a54235d0361732cea04bd7a279e15d20a3deb0/item/downstream.go#L1673
>
> We already have similar special-cases for e.g. WHO/WHOIS:
>
> https://git.sr.ht/~emersion/soju/tree/ec26117c081bbb3406ea04d3ed1bb4f9cec4ab63/item/downstream.go#L1561

I've tried the patch attached below, based on your hints, and it seems
to have suppressed the error messages.

-- 
	Philip K.
Details
Message ID
<vS9kmkn9EbYkio1tUjMBRCBmn_OJLxNU5SXhtdZpuimVFJNOnhl0cSdNAu3p2t3G6ke2EwdBlicvH3IX80zxT5ccuFgvzjn2dEnBBWegedQ=@emersion.fr>
In-Reply-To
<87r1hxqi1l.fsf@icterid> (view parent)
DKIM signature
pass
Download raw message
On Sunday, May 23rd, 2021 at 11:03 PM, Philip Kaludercic <philipk@posteo.net> wrote:

> I've tried the patch attached below, based on your hints, and it seems
> to have suppressed the error messages.

Cool. Can you submit this patch via git-send-email so that I can review
and merge it?

We probably only want to do this if we're in multi-upstream mode (a
`uc.network == nil` check should do it).
Details
Message ID
<cW6h-5IKoOlKv7Zrj1SiRMC0wKaDSU7ZyeCKql009hb0EQt5MR7EAe7GC7AAk2ObH8dMQo0N98vHsTS3QXNLcFVFt-SNegOW5nRFW-J2H64=@emersion.fr>
In-Reply-To
<vS9kmkn9EbYkio1tUjMBRCBmn_OJLxNU5SXhtdZpuimVFJNOnhl0cSdNAu3p2t3G6ke2EwdBlicvH3IX80zxT5ccuFgvzjn2dEnBBWegedQ=@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
On Monday, May 24th, 2021 at 12:39 PM, Simon Ser <contact@emersion.fr> wrote:

> Can you submit this patch via git-send-email so that I can review
> and merge it?

If you aren't familiar with git-send-email: https://git-send-email.io/

If you prefer to submit the patch directly from sr.ht's web UI (like
one would do on GitHub), you can click "Clone repo to your account" on
soju's repo page, push your changes there, then click "Prepare a
patchset" on your repo's page.
Details
Message ID
<878s44qui8.fsf@icterid>
In-Reply-To
<cW6h-5IKoOlKv7Zrj1SiRMC0wKaDSU7ZyeCKql009hb0EQt5MR7EAe7GC7AAk2ObH8dMQo0N98vHsTS3QXNLcFVFt-SNegOW5nRFW-J2H64=@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
Simon Ser <contact@emersion.fr> writes:

> On Monday, May 24th, 2021 at 12:39 PM, Simon Ser <contact@emersion.fr> wrote:
>
>> Can you submit this patch via git-send-email so that I can review
>> and merge it?
>
> If you aren't familiar with git-send-email: https://git-send-email.io/

Don't worry, I have used git-send-email before, I'm just used to
attaching patches to messages because most projects I contribute to
accept that too.

> If you prefer to submit the patch directly from sr.ht's web UI (like
> one would do on GitHub), you can click "Clone repo to your account" on
> soju's repo page, push your changes there, then click "Prepare a
> patchset" on your repo's page.

-- 
	Philip K.
Reply to thread Export thread (mbox)