diff --git a/client.go b/client.go index 36bcb8b..903cd75 100644 --- a/client.go +++ b/client.go @@ -295,7 +295,7 @@ func (cli *Client) OutboxClient(to *Addr) *Client { }, key: cli.key, cache: cli.cache, - state: NewState(), + state: cli.state, lookup: cli.lookup, send: cli.send, } diff --git a/client_test.go b/client_test.go index 8f7bc3c..df53f34 100644 --- a/client_test.go +++ b/client_test.go @@ -28,3 +28,19 @@ func TestClient_Outbox(t *testing.T) { test.True(outbox.Path == expected, "expected %s but got %s", expected, outbox.Path) } + +func TestClient_Outbox_State(t *testing.T) { + req := require.New(t) + + endpoint := &url.URL{Host: "example.com", Path: "/path", Scheme: "https"} + key := keys.GenerateEdX25519Key() + + state := NewState() + var testIndex int64 = 100 + state.SetIndex("testIndex", testIndex) + client := &Client{me: &Addr{endpoint: endpoint}, id: &Identity{key: key}, state: state} + + outboxClient := client.OutboxClient(nil) + req.Equal(state, outboxClient.state) + req.Equal(testIndex, outboxClient.state.GetIndex("testIndex")) +} diff --git a/internal/web/app.wasm b/internal/web/app.wasm index ee52862..ce7c53c 100755 --- a/internal/web/app.wasm +++ b/internal/web/app.wasm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4859acd715745aca7c86ce2f1c65670f390a0ae5bc1ba7eae05317420dc150f3 -size 29231220 +oid sha256:869166394216124ee91c2afe8e07595a0652262cade01a86ac7a0f98436f1ed1 +size 29218993