statechannels / SCBridge-Wallet

MIT License
1 stars 2 forks source link

multiple `OwnerClient`s are being constructed #116

Closed NiloCK closed 11 months ago

NiloCK commented 11 months ago

When opening the UI as Alice or Bob, the constructor's log line gets printed twice.

[vite] connecting... client.ts:18:8
[vite] connected. client.ts:150:14
listening on 0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE-global OwnerClient.ts:18:12
listening on 0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE-global OwnerClient.ts:18:12
[vite] server connection lost. polling for restart... client.ts:105:12

Two constructors calls -> two clients. This causes all sorts of craziness with messaging.

Move back a bit, to 6706c0b1bc253e833f66e7af6fd6deb4a13061e6, this does not happen.

NiloCK commented 11 months ago

3a0b416fb27caa68af94f3cdc42d1e86a751da15 seems to be the offending commit

geoknee commented 11 months ago

I used git-bisect and narrowed it down to this commit 0db9f8cc9dc6346678c574babb7da6c6019bdf0f

geoknee commented 11 months ago

^ which I think makes some sense, since it was probably the first change that caused react to re-render the page. More investigation needed for a fix, though.

NiloCK commented 11 months ago

If this is a clue: it's picking up steam. On main right now

[vite] connecting... client.ts:18:8
[vite] connected. client.ts:150:14
listening on 0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE-global OwnerClient.ts:19:12
listening on 0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE-global OwnerClient.ts:19:12
listening on 0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE-global [2] OwnerClient.ts:19:12

Four alice clients.