~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] server: do not require restart for newly added users

Details
Message ID
<Y8SuKyNb4YYAz5Y5@gutsman.lotheac.fi>
DKIM signature
missing
Download raw message
Patch: +7 -0
if the user exists in the database but was not loaded on daemon startup,
attempt to load it from the database before instructing the operator to
restart the daemon.
---
 server.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server.go b/server.go
index 7d1d305..79c19f2 100644
--- a/server.go
+++ b/server.go
@@ -390,6 +390,13 @@ func (s *Server) forEachUser(f func(*user)) {
func (s *Server) getUser(name string) *user {
	s.lock.Lock()
	u := s.users[name]
	if u == nil {
		dbu, err := s.db.GetUser(context.TODO(), name)
		if err == nil {
			s.addUserLocked(dbu)
			u = s.users[name]
		}
	}
	s.lock.Unlock()
	return u
}
-- 
2.37.3

-- 
Lauri Tirkkonen | lotheac @ IRCnet
Details
Message ID
<GPWg2B9Gpf8m8jvBAAFirBDInrQ7uuWFILnGuwrvbr1dH4kfefpVYvNsIdIRBoa3gs4uSgYTdt4_IR1EmmIcMx3hen80zsk0WudfCci-DjU=@emersion.fr>
In-Reply-To
<Y8SuKyNb4YYAz5Y5@gutsman.lotheac.fi> (view parent)
DKIM signature
missing
Download raw message
Thanks for the patch, but this feature has already been rejected in the
past:

https://lists.sr.ht/~emersion/soju-dev/patches/25249
https://lists.sr.ht/~emersion/soju-dev/patches/26042
Details
Message ID
<Y8Us590mk1LLn0ly@gutsman.lotheac.fi>
In-Reply-To
<GPWg2B9Gpf8m8jvBAAFirBDInrQ7uuWFILnGuwrvbr1dH4kfefpVYvNsIdIRBoa3gs4uSgYTdt4_IR1EmmIcMx3hen80zsk0WudfCci-DjU=@emersion.fr> (view parent)
DKIM signature
missing
Download raw message
On Mon, Jan 16 2023 10:51:33 +0000, Simon Ser wrote:
> Thanks for the patch, but this feature has already been rejected in the
> past:
> 
> https://lists.sr.ht/~emersion/soju-dev/patches/25249
> https://lists.sr.ht/~emersion/soju-dev/patches/26042

Ah, I see, thanks for the explanation, and sorry for the noise. I will
maintain a local patch for this then.

Out of curiosity, is the current behavior not problematic for
chat.sr.ht? I would imagine larger deployments would generally not want
to restart the bouncer :)

-- 
Lauri Tirkkonen | lotheac @ IRCnet
Details
Message ID
<jihIcrJT5z74t0yyGjjbwEWT47y3Lwc-C6KlxzrLKRpueU3ArCtoFDX3L-t9oVW4Q25n9AsCBRopIsHyFP7_sHNWsFoDJByYNibZPldDXu4=@emersion.fr>
In-Reply-To
<Y8Us590mk1LLn0ly@gutsman.lotheac.fi> (view parent)
DKIM signature
missing
Download raw message
On Monday, January 16th, 2023 at 11:54, Lauri Tirkkonen <lauri@hacktheplanet.fi> wrote:

> Out of curiosity, is the current behavior not problematic for
> chat.sr.ht? I would imagine larger deployments would generally not want
> to restart the bouncer :)

chat.sr.ht does not rely on sojuctl to add new users to the bouncer.
This issue only happens when sojuctl is used.

(The plan to fix this mess is to make sojuctl talk to soju instead of
mutating the DB.)
Reply to thread Export thread (mbox)