~emersion/soju-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH] downstream: fix interface type panic for xirc.MembershipSet

Details
Message ID
<20220605201806.793424-1-jeffmartin@gmail.com>
DKIM signature
pass
Download raw message
Patch: +2 -2
---
noticed this when deploying HEAD today
 downstream.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/downstream.go b/downstream.go
index 26032eb..4992546 100644
--- a/downstream.go
+++ b/downstream.go
@@ -3331,8 +3331,8 @@ func sendNames(dc *downstreamConn, ch *upstreamChannel) {
	var members []string
	for _, entry := range ch.Members.innerMap {
		nick := entry.originalKey
		memberships := entry.value.(*xirc.MembershipSet)
		s := formatMemberPrefix(*memberships, dc) + dc.marshalEntity(ch.conn.network, nick)
		memberships := entry.value.(xirc.MembershipSet)
		s := formatMemberPrefix(memberships, dc) + dc.marshalEntity(ch.conn.network, nick)
		members = append(members, s)
	}

--
2.25.1
Details
Message ID
<20220605203323.feqn2x4mibpimbix@x1cats>
In-Reply-To
<20220605201806.793424-1-jeffmartin@gmail.com> (view parent)
DKIM signature
pass
Download raw message
after sending this, i noticed that the issue is actually that sometimes
entry is a pointer, other times a value. sorry for the spam.

On 22/06/05 01:18PM, Jeff Martin wrote:
> ---
> noticed this when deploying HEAD today
>  downstream.go | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/downstream.go b/downstream.go
> index 26032eb..4992546 100644
> --- a/downstream.go
> +++ b/downstream.go
> @@ -3331,8 +3331,8 @@ func sendNames(dc *downstreamConn, ch *upstreamChannel) {
>  	var members []string
>  	for _, entry := range ch.Members.innerMap {
>  		nick := entry.originalKey
> -		memberships := entry.value.(*xirc.MembershipSet)
> -		s := formatMemberPrefix(*memberships, dc) + dc.marshalEntity(ch.conn.network, nick)
> +		memberships := entry.value.(xirc.MembershipSet)
> +		s := formatMemberPrefix(memberships, dc) + dc.marshalEntity(ch.conn.network, nick)
>  		members = append(members, s)
>  	}
>
> --
> 2.25.1
>
Details
Message ID
<A-MRBV__YE8K2uXHj5zd2RYluszs1bScdhlvULPSrvZg1FhQFgGu4McrIB6n4dEuK3Lbr-xhtJh5pcJ29gXzD1T6byi5da4tt9ITSBsQDOk=@emersion.fr>
In-Reply-To
<20220605203323.feqn2x4mibpimbix@x1cats> (view parent)
DKIM signature
pass
Download raw message
On Sunday, June 5th, 2022 at 22:33, Jeff Martin <jeffmartin@gmail.com> wrote:

> after sending this, i noticed that the issue is actually that sometimes
> entry is a pointer, other times a value. sorry for the spam.

Ah good catch! We should always store the pointer, because we often fetch
the entry and then mutate it. A value wouldn't properly perform the mutation
in the map.
Details
Message ID
<92ABGFdT3LKrnWZCppMlEV2D1m2cjhXNrL_fj_fx3JwlU1CZueRLuNm6RM8RtWWUIzqS3FaYSl9k-o_fxSpLK4sdu-ZGVTfPGhVwxDptUc4=@emersion.fr>
In-Reply-To
<20220605203323.feqn2x4mibpimbix@x1cats> (view parent)
DKIM signature
pass
Download raw message
Should be fixed by this commit:
https://git.sr.ht/~emersion/soju/commit/657e25b25c47511ac8a1bb042d0bc9481a813e3b
Reply to thread Export thread (mbox)