home · contact · privacy
Don't trigger update logs on auto-creation of (at that point still uselessly empty...
authorChristian Heller <c.heller@plomlompom.de>
Thu, 20 Nov 2025 01:06:42 +0000 (02:06 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 20 Nov 2025 01:06:42 +0000 (02:06 +0100)
14 files changed:
src/ircplom/client.py
src/ircplom/db_primitives.py
src/tests/caps.test
src/tests/channels.test
src/tests/isupports.test
src/tests/lib/001-setting-nick
src/tests/lib/caps-data-set [deleted file]
src/tests/lib/join-empty
src/tests/lib/part
src/tests/lib/req-sasl
src/tests/lib/user-set-to
src/tests/lib/usermode
src/tests/test.test
src/tests/userset.test

index d9acd6aa4c2c3c6078aa072f5ba55ad3e5c334a7..0dd6679b763c61678e6b3925712cca7dd52464f2 100644 (file)
@@ -483,26 +483,35 @@ class _ClientDb(Clearable, UpdatingAttrsMixin, SharedClientDbFields):
         cache_path: tuple[str, ...] = tuple()
         for step in path[:-1]:
             cache_path = cache_path + (step,)
-            if cache_path in self._updates_cache:
-                del self._updates_cache[cache_path]
+            if cache_path in self._updates_cache:    # un-cache any path steps
+                del self._updates_cache[cache_path]  # to node we deem updated
             parent = (parent[step] if isinstance(parent, Dict)
                       else getattr(parent, step))
         last_step = path[-1]
         val_at_path = ((parent[last_step] if last_step in parent.keys()
                         else None) if isinstance(parent, Dict)
                        else getattr(parent, last_step))
+
+        # treat anything without UpdatingMixin as single endnode to return
+        # (NB: this would include None!)
         if not isinstance(val_at_path, UpdatingMixin):
             return update_unless_cached(path, val_at_path)
+
+        # for completable, only return its .completed
         if isinstance(val_at_path, Completable):
             if val_at_path.completed is not None:
                 return update_unless_cached(path, val_at_path.completed)
             return []
+
+        # for empty Dict, return clearing signal
         if isinstance(val_at_path, Dict) and not val_at_path.keys():
             for cache_path in [p for p in self._updates_cache
                                if len(p) > len(path)
                                and p[:len(path)] == path]:
                 del self._updates_cache[cache_path]
             return update_unless_cached(path, None)
+
+        # if node at path has children, (only) return _their_ endnode updates
         if isinstance(val_at_path, Dict):
             sub_items = val_at_path.keys()
         else:
index f2bf8ee9941095c4237b4d8bf564cb7e391e88f0..d62afa6881989297917979ad3b55d3f6373089a0 100644 (file)
@@ -48,11 +48,12 @@ class Dict(Clearable, Generic[DictItem]):
                     else self.__orig_bases__[0])
         return orig_cls.__args__[0]
 
-    # NB: Some of below wrappers around ._dict method calls were previously
-    # replaced by .__getattribute__ simply returning getattr(self._dict, key).
-    # This however confused subclasses super() (which doesn't check instance's
-    # .__getattribute__ but looks at class method definitions), and wouldn't
-    # satisfy abstractmethod slots such as for Clearable.clear.
+    # NB, not to repeat this mistake: Some of below wrappers around ._dict
+    # method calls were previously replaced by .__getattribute__ simply
+    # returning getattr(self._dict, key).  This however confused subclasses'
+    # super() (which won't check instance's .__getattribute__, rather looks
+    # at class method definitions), nor satisfy abstractmethod slots such as
+    # for Clearable.clear.
 
     def __setitem__(self, key: str, val: DictItem) -> None:
         assert isinstance(val, self._item_cls), (type(val), self._item_cls)
@@ -214,7 +215,7 @@ class UpdatingDict(UpdatingMixin, Dict[DictItem]):
                 if UpdatingMixin in self._item_cls.__mro__:
                     kw |= {'on_update':
                            lambda *steps: self._on_update(key, *steps)}
-                self[key] = self._item_cls(**kw)
+                self._dict[key] = self._item_cls(**kw)
         return super().__getitem__(key)
 
     def __setitem__(self, key: str, val: DictItem) -> None:
index 1c951d4bc54fc61a075b9ca9a2fc49212fd8ac71..63d9c3fd1986a56377577082f089747739beb81f 100644 (file)
@@ -3,7 +3,6 @@ insert ./lib/attempting-to-connected
 insert ./lib/connect-to-connected
 insert ./lib/cap-msg
 insert ./lib/caps-neg-empty
-insert ./lib/caps-data-set
 insert ./lib/cmd-disconnect
 # for: cmd-disconnect
 insert ./lib/disconnect
@@ -54,7 +53,7 @@ log 1 $ caps:zab:data set to: []
 log 1 $ caps:zba:data set to: []
 log 1 > CAP :LIST
 insert cap-msg : + CAPMSG :foo LIST * :foo rab oof
-insert user-set-to :3 + USER_ID=me USERNICK :foo
+insert user-set-to :1 + USER_ID=me USERNICK :foo
 insert cap-msg : + CAPMSG :foo LIST :zab rba
 log 1 $ caps:foo:enabled set to: [True]
 log 1 $ caps:oof:enabled set to: [True]
@@ -81,7 +80,7 @@ log 1 > CAP :END
 
 # check NEW, DEL working after CAP :END
 insert cap-msg : + CAPMSG :foo NEW :foo bar=baz
-insert caps-data-set : + CAPNAME=bar CAPVAL :baz
+log 1 $ caps:bar:data set to: [baz]
 log 1 $ caps:foo:data set to: []
 insert cap-msg : + CAPMSG :foo DEL :sasl foo
 log 1 $ caps:foo cleared
index 37460ddedeaa5cf80900e541569c95d7629e9455..5aa13e8f3e3f2308fa8f19d69ba0f37f2741a0ac 100644 (file)
@@ -12,7 +12,7 @@ insert ./lib/disconnect
 insert ./lib/join-empty
 # for: join-channel-0, join-channel-1, join-empty
 insert ./lib/part
-# for: exit-channel, part, parts-core, quit
+# for: exit-channel, part, part-0, part-1, parts-core, quit
 insert ./lib/privmsg
 insert ./lib/retry-in
 insert ./lib/servermsglogged
@@ -99,7 +99,7 @@ insert part-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
 
 # check /join to, and part from, channel with one other user
 insert join-channel-0 : + CHANNEL=#ch_test0 RESIDENT_NAMES :foo bar
-insert user-set-to :3 + USER_ID=1 USERNICK :bar
+insert user-set-to :1 + USER_ID=1 USERNICK :bar
 insert join-channel-1 : + CHANNEL=#ch_test0 RESIDENT_IDS :[1], [me]
 log 3 $ residents: bar, foo
 insert part : + CHANNEL=#ch_test0 CHAN_WIN_ID=3 USERIDS_CLEAR :set to: [1]
@@ -107,11 +107,11 @@ log 1 $ users:1 cleared
 
 # check /join into channel with many other users, with multi-line 353
 insert join-channel-0 : + CHANNEL=#ch_test0 RESIDENT_NAMES :foo baz oof
-insert user-set-to :3 + USER_ID=2 USERNICK :baz
-insert user-set-to :3 + USER_ID=3 USERNICK :oof
+insert user-set-to :1 + USER_ID=2 USERNICK :baz
+insert user-set-to :1 + USER_ID=3 USERNICK :oof
 insert servermsglogged : + MSG ::foo.bar.baz 353 foo = #ch_test0 :rab zab
-insert user-set-to :3 + USER_ID=4 USERNICK :rab
-insert user-set-to :3 + USER_ID=5 USERNICK :zab
+insert user-set-to :1 + USER_ID=4 USERNICK :rab
+insert user-set-to :1 + USER_ID=5 USERNICK :zab
 insert join-channel-1 : + CHANNEL=#ch_test0 RESIDENT_IDS :[2], [3], [4], [5], [me]
 log 3 $ residents: baz, oof, rab, zab, foo
 
@@ -120,16 +120,15 @@ log 3 $ residents: baz, oof, rab, zab, foo
 insert part-empty : + CHAN_WIN_ID=4 CHANNEL :#ch_test1
 insert join-channel-0-0 : + CHANNEL :#ch_test1
 insert servermsglogged : + MSG ::foo.bar.baz 332 foo #ch_test1 :foo bar baz
-log 1 $ channels:#ch_test1:exits cleared
 insert servermsglogged : + MSG ::foo.bar.baz 333 foo #ch_test1 baz!~baz@OLD.baz.baz 1234567890
 insert topic-set-to : + baz.baz=OLD.baz.baz CHANNEL=#ch_test1 NEWTOPIC :foo bar baz
-insert join-channel-0-1 :-1 + CHANNEL=#ch_test1 RESIDENT_NAMES :foo baz
+insert join-channel-0-1 : + CHANNEL=#ch_test1 RESIDENT_NAMES :foo baz
 insert join-channel-1 : + CHANNEL=#ch_test1 RESIDENT_IDS :[2], [me]
 log 4 $ residents: baz, foo
 
 # check _observed_ topic change _does_ affect users database, and …
 insert servermsglogged : + MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo bar baz
-insert user-set-to 3: + USER_ID=2 USERNAME=~baz USERHOST :baz.baz
+insert user-set-to 1: + USER_ID=2 USERNAME=~baz USERHOST :baz.baz
 
 # … is echoed into channel window _if_ either content or setter change
 insert topic-set-to : + CHANNEL=#ch_test1 NEWTOPIC :foo bar baz
@@ -141,7 +140,7 @@ insert topic-set-to : + CHANNEL=#ch_test1 NEWTOPIC :foo foo baz
 insert servermsglogged : + MSG ::baz!~baz@baz.baz PRIVMSG #ch_test0 :msg_test3 msg_test4
 log 3 < [baz] msg_test3 msg_test4
 insert servermsglogged : + MSG ::oof!~oof@oof.oof NOTICE #ch_test0 :msg_test5 msg_test6
-insert user-set-to 3: + USER_ID=3 USERNAME=~oof USERHOST :oof.oof
+insert user-set-to 1: + USER_ID=3 USERNAME=~oof USERHOST :oof.oof
 log 3 < (oof) msg_test5 msg_test6
 
 # check effect of server NOTICE to channel
@@ -150,13 +149,15 @@ log 3 < (*.?.net) msg_test6 msg_test7
 
 # check part of user visible, and of user NOT visible in other channel
 insert part-other : + NICK=baz USER_ID=2 REMAINING_IDS :[3], [4], [5], [me]
-insert part-other : + NICK=oof USER_ID=3 REMAINING_IDS :[4], [5], [me]
+# !!!!
+insert part-other :2 + NICK=oof USER_ID=3 REMAINING_IDS :[4], [5], [me]
+insert part-other 3: + NICK=oof USER_ID=3 REMAINING_IDS :[4], [5], [me]
 log 1 $ users:3 cleared
 
 # check other-user part with exit message
 insert servermsglogged : + MSG ::zab!~zab@zab.zab PART #ch_test0 :goodbye
-insert user-set-to 3: + USER_ID=5 USERNAME=~zab USERHOST :zab.zab
-insert parts-core : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=5 NICK=zab exitPREFIX=:§ exitMSG=goodbye USERIDS_CLEAR=set§to:§[4],§[me] § : 
+insert user-set-to 1: + USER_ID=5 USERNAME=~zab USERHOST :zab.zab
+insert parts-core 1: + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=5 NICK=zab exitPREFIX=:§ exitMSG=goodbye USERIDS_CLEAR=set§to:§[4],§[me] § : 
 log 1 $ users:5 cleared
 
 # check re-join of user kept visible in other channel
@@ -182,14 +183,15 @@ insert cmd-nick : + NUH=myself!~baz@baz.bar.foo USER_ID=me NEWNICK :foo
 insert servermsglogged : + MSG ::baz!~baz@baz.baz QUIT :Client Quit
 log 1 $ users:2:exit_msg set to: [QClient Quit]
 log , $ baz!~baz@baz.baz quits: Client Quit
-insert quit : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=2 NICK=baz REMAINING_IDS :[4], [6], [me]
+insert quit 1: + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=2 NICK=baz REMAINING_IDS :[4], [6], [me]
 insert quit : + CHAN_WIN_ID=4 CHANNEL=#ch_test1 USER_ID=2 NICK=baz REMAINING_IDS :[me]
 log 1 $ users:2 cleared
 
 # check effects of own QUIT while present in one channel
-insert part-empty : + CHAN_WIN_ID=4 CHANNEL :#ch_test1
+insert part-0 : + CHANNEL :#ch_test1
+insert part-1 1: + CHAN_WIN_ID=4 USERIDS_CLEAR=cleared CHANNEL :#ch_test1
 insert cmd-disconnect-0
-insert quit : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo REMAINING_IDS :[4], [6]
+insert quit 1: + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo REMAINING_IDS :[4], [6]
 insert cmd-disconnect-1 :-1
 insert disconnect1 : + WIN_IDS :2,3,4
 
index 7cddea251e2bf2355a99600fed5c2a53f03e40b0..543603454d2f8b976f587a2fd52522cb23ac5d81 100644 (file)
@@ -83,15 +83,15 @@ insert join-empty : + CHAN_WIN_ID=6 CHANNEL :#ch_test5
 
 # test effect of PREFIX
 insert join-channel-0 : +0 CHANNEL=#ch_test6 RESIDENT_NAMES :foo @bar +baz =quux
-insert user-set-to :3 +1 USER_ID=1 USERNICK :bar
-insert user-set-to :3 +1 USER_ID=2 USERNICK :baz
-insert user-set-to :3 +1 USER_ID=3 USERNICK :=quux
+insert user-set-to :1 +1 USER_ID=1 USERNICK :bar
+insert user-set-to :1 +1 USER_ID=2 USERNICK :baz
+insert user-set-to :1 +1 USER_ID=3 USERNICK :=quux
 insert join-channel-1 : +0 CHANNEL=#ch_test6 RESIDENT_IDS :[1], [2], [3], [me]
 log 7 $ residents: bar, baz, =quux, foo
 insert un-default : +0 KEY=PREFIX VALUE :(vE)+=
 insert join-channel-0 : +0 CHANNEL=#ch_test7 RESIDENT_NAMES :foo @bar +baz =quux
-insert user-set-to :3 +1 USER_ID=4 USERNICK :@bar
-insert user-set-to :3 +1 USER_ID=5 USERNICK :quux
+insert user-set-to :1 +1 USER_ID=4 USERNICK :@bar
+insert user-set-to :1 +1 USER_ID=5 USERNICK :quux
 insert join-channel-1 : +0 CHANNEL=#ch_test7 RESIDENT_IDS :[2], [4], [5], [me]
 log 8 $ residents: baz, @bar, quux, foo
 
index d01f3548c1c81bcd70e4623a22f349c23542089a..5151ef1b2c57bae86dbf6a74fda096d2c98f9e76 100644 (file)
@@ -3,4 +3,4 @@ insert ./lib/user-set-to
 
 × 001-setting-nick
 insert servermsglogged : +0 MSG ::foo.bar.baz 001 foo :Welcome to the foo.bar.baz network
-insert user-set-to :3 +1 USER_ID=me USERNICK :foo
+insert user-set-to :1 +1 USER_ID=me USERNICK :foo
diff --git a/src/tests/lib/caps-data-set b/src/tests/lib/caps-data-set
deleted file mode 100644 (file)
index bc03241..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-× caps-data-set
-log 1 $ caps:CAPNAME:data set to: []
-log 1 $ caps:CAPNAME:data set to: [CAPVAL]
index a89572acbbfa1e2216ee301dbbc6f3c1c3950344..3db819251b2fcf9a638a4e832a40cddac7beb2b7 100644 (file)
@@ -7,7 +7,6 @@ insert servermsglogged : + MSG ::foo!~baz@baz.bar.foo JOIN :CHANNEL
 
 × join-channel-0-1
 insert servermsglogged : + MSG ::foo.bar.baz 353 foo = CHANNEL :RESIDENT_NAMES
-log 1 $ channels:CHANNEL:exits cleared
 
 × join-channel-0
 insert join-channel-0-0
index 3fbfb42add742686675d12982614b0b0e27864a9..7f4a662fb9b7460c331e1c2587f9240938a16ca6 100644 (file)
@@ -1,6 +1,7 @@
 insert ./lib/servermsglogged
 
 × exit-channel
+log 1 $ channels:CHANNEL:exits cleared
 log 1 $ channels:CHANNEL:exits:USER_ID set to: [exitTYPEexitMSG]
 log 1 $ channels:CHANNEL:user_ids USERIDS_CLEAR
 log CHAN_WIN_ID $ NICK!~NICK@NICK.NICK exitDESCexitPREFIXexitMSG
@@ -9,13 +10,19 @@ log 1 $ channels:CHANNEL:exits:USER_ID cleared
 × parts-core
 insert exit-channel : + exitTYPE=P exitDESC :parts
 
-× part
+× part-0
 > /part
 log 1 > PART :CHANNEL
 insert servermsglogged : + MSG ::foo!~baz@baz.bar.foo PART :CHANNEL
+
+× part-1
 insert parts-core : + exitPREFIX= exitMSG= USER_ID=me NICK=foo foo@foo.foo :baz@baz.bar.foo
 log 1 $ channels:CHANNEL cleared
 
+× part
+insert part-0
+insert part-1
+
 × quits
 insert exit-channel : + exitTYPE=Q exitDESC=quits exitPREFIX=:§ exitMSG=Client§Quit § : 
 
index 55b132496f4a8cb12cd68cdccbb988a34892efa1..4006cdb7f3a6a621774c262f329dd21b5bf446e9 100644 (file)
@@ -1,16 +1,15 @@
 insert ./lib/cap-msg
-insert ./lib/caps-data-set
 insert ./lib/user-set-to
 
 × req-sasl
 log 1 > CAP REQ :sasl
 log 1 > CAP :LIST
 insert cap-msg : +0 CAPMSG :foo REPLY :sasl
-insert user-set-to :3 + USER_ID=me USERNICK :foo
+insert user-set-to :1 + USER_ID=me USERNICK :foo
 insert cap-msg : +0 CAPMSG :foo LIST :CAPLIST
 
 × get-sasl-plain
 insert cap-msg : + CAPMSG :* LS :sasl=PLAIN
-insert caps-data-set : + CAPNAME=sasl CAPVAL :PLAIN
+log 1 $ caps:sasl:data set to: [PLAIN]
 insert req-sasl : + REPLY=ACK CAPLIST :sasl
 log 1 $ caps:sasl:enabled set to: [True]
index da5bf50fe782cbd2d5fb0c1361786ae7f974e02d..484742233f871f5eef931111256d401cece98d09 100644 (file)
@@ -1,6 +1,4 @@
 × user-set-to
-log 1 $ users:USER_ID:nick set to: [?]
-log 1 $ users:USER_ID:modes set to: []
 log 1 $ users:USER_ID:nick set to: [USERNICK]
 log 1 $ users:USER_ID:user set to: [USERNAME]
 log 1 $ users:USER_ID:host set to: [USERHOST]
index 41755d06c0b848fcce7a0e889ce98111f8a0c5b6..27edba3802f5186d6b62d05b4928e9a9aca3c24f 100644 (file)
@@ -3,5 +3,5 @@ insert ./lib/user-set-to
 
 × usermode
 insert servermsglogged : +0 MSG ::foo!~baz@baz.bar.foo MODE foo +ABC
-insert user-set-to 3: +1 USER_ID=me USERNAME=~baz USERHOST :baz.bar.foo
+insert user-set-to 1: +1 USER_ID=me USERNAME=~baz USERHOST :baz.bar.foo
 log 1 $ users:me:modes set to: [ABC]
index 4e3a9fdd1976e041b730b0580035c8191bc3dcde..5607e9bf6a91959548bd126a20b5091be1b20f10 100644 (file)
@@ -1,6 +1,5 @@
 insert ./lib/attempting-to-connected
 insert ./lib/cap-msg
-insert ./lib/caps-data-set
 insert ./lib/cmd-disconnect
 insert ./lib/cmd-nick
 insert ./lib/conn
@@ -14,7 +13,7 @@ insert ./lib/join-empty
 # for: join-channel-0, join-channel-1
 insert ./lib/no-handler
 insert ./lib/part
-# for: part, quit, quits
+# for: part-0, part-1, quit, quits
 insert ./lib/pingpong
 insert ./lib/privmsg
 insert ./lib/req-sasl
@@ -48,7 +47,7 @@ log 1 $ caps:bar:data set to: []
 log 1 $ caps:baz:data set to: []
 log 1 $ caps:cap-notify:data set to: []
 log 1 $ caps:foo:data set to: []
-insert caps-data-set : +1 CAPNAME=sasl CAPVAL :IGNORE
+log 1 $ caps:sasl:data set to: [IGNORE]
 insert req-sasl : +0 foo=foo1 REPLY=ACK CAPLIST :cap-notify sasl
 log 1 $ caps:cap-notify:enabled set to: [True]
 log 1 $ caps:sasl:enabled set to: [True]
@@ -113,7 +112,7 @@ log rename_win_ids $ foo1!~baz@baz.bar.foo renames foo
 
 # join channel with other user
 insert join-channel-0 : +0 CHANNEL=#test RESIDENT_NAMES :foo @baz
-insert user-set-to :3 +1 USER_ID=1 USERNICK :baz
+insert user-set-to :1 +1 USER_ID=1 USERNICK :baz
 insert join-channel-1 : +0 CHANNEL=#test RESIDENT_IDS :[1], [me]
 log 4 $ residents: baz, foo
 
@@ -155,7 +154,8 @@ log 1 $ users:2 cleared
 
 # handle self-PART: clear channel, and its squatters
 > /window 4
-insert part : +0 CHAN_WIN_ID=4 CHANNEL=#test USERIDS_CLEAR :set to: [1]
+insert part-0 : + CHANNEL :#test
+insert part-1 1: + CHAN_WIN_ID=4 CHANNEL=#test USERIDS_CLEAR :set to: [1]
 log 1 $ users:1 cleared
 
 # handle lack of implementation
@@ -164,7 +164,7 @@ insert no-handler : +0 ALERT_WIN_IDS=2,3,4,5,6,7 ? :foo bar baz
 # handle /disconnect, clear all
 insert cmd-disconnect-0 :-1
 log 3,6,7 $ foo!~baz@baz.bar.foo quits: Client Quit
-insert quits : + CHAN_WIN_ID=5 CHANNEL=#testtest USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo USERIDS_CLEAR :cleared
+insert quits 1: + CHAN_WIN_ID=5 CHANNEL=#testtest USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo USERIDS_CLEAR :cleared
 insert cmd-disconnect-1 : +0
 insert disconnect1 :-1 +1 WIN_IDS :2,3,4,5,6,7
 log 1 $ motd cleared
index fe3b63dd2c4a6eda0f691fd7b12adbb82453f8e2..028749af97e496cc9ea8494b047aae64b5693e3a 100644 (file)
@@ -57,11 +57,11 @@ insert connecting-to-nick
 insert cap-msg : +0 CAPMSG :* LS :
 log 1 > CAP :LIST
 insert cap-msg : +0 CAPMSG :foo LIST :
-insert user-set-to :3 + USER_ID=me USERNICK :foo
+insert user-set-to :1 + USER_ID=me USERNICK :foo
 log 1 > CAP :END
 #
 insert cmd-disconnect-0 :-2 + ~baz@baz.bar.foo :~foo@foo.foo
-insert user-set-to 3: + USER_ID=me USERNAME=~foo USERHOST :foo.foo
+insert user-set-to 1: + USER_ID=me USERNAME=~foo USERHOST :foo.foo
 insert cmd-disconnect-0 -2: + ~baz@baz.bar.foo :~foo@foo.foo
 insert cmd-disconnect-1 :-1
 insert disconnect1 1: + WIN_IDS :2
@@ -72,7 +72,7 @@ insert cap-to-auth
 insert end-auth : + NUMERIC=904 SASL_STATE :failed
 #
 insert cmd-disconnect-0 :-2 + ~baz@baz.bar.foo :~foo@foo.foo
-insert user-set-to 3: + USER_ID=me USERNAME=~foo USERHOST :foo.foo
+insert user-set-to 1: + USER_ID=me USERNAME=~foo USERHOST :foo.foo
 insert cmd-disconnect-0 -2: + ~baz@baz.bar.foo :~foo@foo.foo
 insert cmd-disconnect-1
 insert disconnect1 1:-1 + WIN_IDS :2
@@ -83,7 +83,7 @@ insert disconnect1 -1:
 insert connecting-to-nick
 insert cap-to-auth
 insert servermsglogged : + MSG ::foo.bar.baz 900 foo foo!foo@foo.foo foo :You are now logged in as foo
-insert user-set-to 3: + USER_ID=me USERNAME=foo USERHOST :foo.foo
+insert user-set-to 1: + USER_ID=me USERNAME=foo USERHOST :foo.foo
 log 1 $ sasl_account set to: [foo]
 insert end-auth : + NUMERIC=903 SASL_STATE :successful