Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 01 10:14

    ai on main

    Update README.md (#91) (compare)

  • Jun 01 10:14
    ai closed #91
  • Jun 01 08:07
    proofit404 opened #91
  • Apr 24 21:47

    ai on main

    Fix nano-staged config (compare)

  • Apr 24 21:45

    ai on main

    Update CI, dependencies and lin… (compare)

  • Mar 26 12:38

    ai on main

    Update CI config (compare)

  • Mar 26 12:37

    ai on main

    Update dependencies (compare)

  • Jan 10 06:45

    ai on main

    Fix spelling check (compare)

  • Jan 10 06:42

    ai on main

    Promote Vite instead of Parcel Update dependencies (compare)

  • Dec 23 2021 23:41

    ai on main

    Fix remark plugins (compare)

  • Dec 23 2021 23:37
    ai commented #90
  • Dec 23 2021 23:36

    ai on main

    Update dependencies Add ignore-scripts to yarn in D… Move from Yarn to pnpm (compare)

  • Dec 23 2021 23:24

    ai on main

    Adds recipe about deployment (#… (compare)

  • Dec 23 2021 23:24
    ai closed #90
  • Dec 22 2021 17:49
    vitalybaev synchronize #90
  • Dec 22 2021 16:39
    vitalybaev edited #90
  • Dec 22 2021 16:38
    vitalybaev opened #90
  • Nov 21 2021 17:58

    ai on main

    Clean up dependencies (compare)

  • Sep 28 2021 20:35
    ai commented #89
  • Sep 28 2021 18:01
    vitalybaev commented #89
Ilya Radchenko
@knownasilya
I can't do a type room/:id/ENTERED
6 replies
Ilya Radchenko
@knownasilya
Has anyone deployed on google cloud run? It's docker based but also works for just plain node apps. Says it supports WS, but not sure.
8 replies
Ilya Radchenko
@knownasilya
Where else did you guys deploy a docker image that it worked?
1 reply
Ilya Radchenko
@knownasilya
Looks like I needed host 0.0.0.0 instead of 127.0.0.1
I didn't notice the comment here: https://logux.io/recipes/deployment/
Ilya Radchenko
@knownasilya
I would love to see some state chart features built in, like you can only fire these events if you are in this channel. Other events are ignored (logged).
Felix Green
@felixakiragreen

hey! I'm a frontend dev, so I apologize if this is a stupid question. I'm wondering if I can use Logux without creating a backend for it? (personal project)

I have a frontend & a postgres db (supabase), and it supports WS connections. But I've gotten this far without having to make a backend... so I was wondering if maybe there was a way to use/wrap the proxy server on the frontend so I wouldn't need a whole separate thing.

3 replies
lunayap
@lunayap
Hi, I am not sure if this question has been asked before or not, but, is it possible to hook a Flutter app to logux server? Is it hard to implement? thank you
1 reply
how about React Native. has it been done before?
1 reply
Kasey
@kculmback
Hello, we are evaluating Logux for a new project that will need real time collaboration. Our application will be interfacing with microservice architecture, so the data that we are syncing across clients will be coming from multiple services/databases and potentially third party APIs. Data will also need to be persisted to these various services. Is this a use case that Logux would work for? Is there any examples or resources on how best to handle this with Logux (I have not noticed any in the docs)?
8 replies
OfficeDroneV2
@OfficeDroneV2

Any examples on logux/redux? Trying logux out with a counter app. I have two clients and for some reason one of the clients doesn't always update its state when reconnecting from offline mode. For example, when I disconnect both clients from internet and I decrement twice on client A and increment 3 times on client B, then when I reconnect, only one of the clients update correctly while the other one doesn't update at all. Changes from both clients do get applied at server.

Looking at ws traffic I can see both clients send actions done while it was offline to the server, and the server responds with "logux/processed" to them, but then it only replicates those actions to Client A and not Client B..

19 replies
John
@Jo86384449_twitter
Hi, I'm experimenting with the new addSyncMap() which is a really great addition to handle sync-maps! All works fine but I noticed that finished actions like tasks/changed are send to clients that should not receive them. Here https://github.com/logux/server/blob/main/add-sync-map/index.js#L14 it seems that only the sending client is excluded by default so that they are send to all clients or channel subscribers? How can we control who receives these actions?
7 replies
yinz
@uinz

Hi everyone, I have a question about CRDT.

Suppose I have an Array<string> field like [1,2,3]

User A wants to insert 'a' after 1

User B wants to insert 'b' after 2

The desired final result should be [1, 'a', 2, 'b', 3]

Can the above behavior be done with the changeSyncMap API?

//A
changeSyncMap(store, { arr: [1, 'a', 2, 3 ] })

// B
changeSyncMap(store, { arr: [1, 2, 'b' , 3 ] })
3 replies
As far as I know, notion does not use a CRDT to handle conflicts though.
But it provides a set of listBefore listAfter listRemove operators to handle array behavior
Adam Binks
@adam-binks
Hi! I'm following the "Use Logux with Typescript" recipe, but I'm having trouble importing the file that creates the actions. I have the action file in client/common/mapActions.ts, and want to import it from server/index.ts. What's the best way to do this?
5 replies
Nikita
@nikitavoloboev
Can I use Logux with https://www.solidjs.com ?
Nikita
@nikitavoloboev
ok got answer from @ai on Twitter
image.png
Nikita
@nikitavoloboev
going to try read through Logux docs and https://github.com/nanostores/solid and maybe get it running
Adam Binks
@adam-binks
A more philosophical question: how many subscriptions? I'm building a mapping tool. The <Map> will subscribe to changes in the map. The map will have nodes on it (maybe 10-100), and these might be shared between multiple maps. So should each <Node> subscribe to changes on that node? Or would it be better for the node's action processors to all resend their actions to all the maps that contain that node?
4 replies
Can Rau
@CanRau
Hey y'all ☺️ I'm trying to connect multiple servers and wonder what the best way is to do so? Couldn't find any examples only that all clients and servers are nodes. The plan is that the app will later scale to multiple instances, each instance has its own IPv6 address, then I want to connect to all IPv6 addresses except the current instances one of course to form a mesh to keep server data in sync, SQLite data to be exact. Would highly appreciate any input 😇🙏
7 replies
So far only found https://logux.io/node-api/#server-subscribe but it expects a Node ID and not a host address. Would I create a new Server() for each and subscribe to their Node IDs?
3 replies
Can Rau
@CanRau
Alternatively I'm considering using GunDB 🤔
Robin Christ
@robinchrist

I just discovered Logux and it looks very nice so far!

I'm wondering: Would Logux be suitable for a project that has a lot of state updates? We would have some kind of live monitoring of connected devices (up to 200) which send a status updates to the server every 100ms (every device on its own, so you'd have a state update in the server probably every 4ms or so), which then need to be distributed to the client.
Is there some kind of throttling logic to consolidate certain state updates and only send them out every ~100-200ms?

12 replies
Cadel Watson
@kdelwat

Hi everyone, I've been building an app with Logux and it's been awesome. I'm trying now to implement file uploads, and I wanted to keep them outside of the Logux state so that I didn't have large payloads in the event history. However I'm struggling to get Redux thunks working at all with Logux.

I add in the Redux thunk middleware like so:

const createStore = createStoreCreator(client);
const store = createStore(
  reducer,
  composeWithDevTools(
    applyMiddleware(
      thunkMiddleware.withExtraArgument({ serverAddress: httpServerAddress })
    )
  )
);

But when I try to dispatch a thunk I get this error:

Uncaught (in promise) Error: Expected "type" in action
    at Log.add (index.js:47:13)
    at store.dispatch (index.js:63:11)
    at Object.drop (App.tsx:61:11)
    at DropTargetImpl.drop (DropTargetImpl.ts:30:16)
    at determineDropResult (drop.ts:53:35)
    at drop.ts:23:23
    at Array.forEach (<anonymous>)
    at DragDropManagerImpl.drop (drop.ts:22:13)
    at Object.drop (DragDropManagerImpl.ts:50:34)
    at HTML5BackendImpl.handleTopDrop (HTML5BackendImpl.ts:724:16)

This implies to me that either (a) Logux doesn't support thunk payloads at all and always requires a plain object with a type field or (b) I'm somehow not adding the middleware correctly.

Has anyone tried this before / have any pointers?

6 replies
Tyler Han
@DecathectZero
Hi logux! I'm running into quite a unique race condition -
Suppose there is one user on and they are making frequent updates. When a second user comes on, during subscription there is a chance that the data they fetch from to the database during the channel initialization is actually out of date and they don't receive the additional actions. I've also noticed this is the case during reconnecting, it will sometimes subscribe and initialize again and miss actions.
4 replies
Ben Teichman
@effervescentia

Hi logux & @ai ! I found a nasty bug with the logux/redux implementation that can cause an action to be processed twice in a row when local dispatch actions are interleaved with dispatch.sync actions and a replay is triggered.

To be clear this bug CORRUPTS THE DATA IN THE STORE by processing an action once as part of a replay then a second time using the final state from the replay as its input. For a simple example an "ADD" operation would result in the same item appearing in a list twice (potentially with radically different data depending on the logic of the reducers used).

I've detailed the bug and how it occurs in my pull request which also includes a simple fix (invalidating the wait lookup early to skip processing for everything included in a replay) as well as a test that reproduces the case in isolation and validates my fix.

logux/redux#46

1 reply
Tyler Han
@DecathectZero
Hi logux team, from my earlier comment about race conditions. I've done some further investigation and have submitted a PR. Happy to continue the discussion there. Cheers!
logux/client#94
2 replies
Tyler Han
@DecathectZero

Hi logux team, appreciate all the help we've been receiving. I have an additional question about syncing. Our current setup is React/Redux client -> NodeJS Logux Server -> NodeJS API server -> Database.

I notice when a user tries to sync after reconnecting, they dump all actions to the Logux Server, which tries to handle them and writes "synchronized" back to the client . However just because it is "synchronized" does not mean it is done processing. The client then sends "subscribe" back and the channel tries to fetch the document before all the API server-DB have finished processing.

3 replies
Tyler Han
@DecathectZero

One additional follow up question as we've been working on the offline behavior (logux/redux):
await dispatch.sync(...) only resolves when the server has sent back 'processed'.

However in many cases, especially when we are offline, this would never resolve.
We just want to wait for the local redux store state to be updated, 'change', and proceed with subsequent dependent actions. Is there a good way to achieve this?

3 replies
Tyler Han
@DecathectZero

Okay I think I finally figured out what is happening in a reconnection race condition:

There are 2 clients - let’s call them 1 and 2. Everything here happens in sequence:

  • 1 and 2 are both disconnected
  • 1 makes a bunch of actions, 2 makes a bunch of actions
  • 1 reconnects first, all of their edits are sent out to the server from syncSince, 2 does not receive these actions since they are still offline
  • 1 re-subscribes to the channel, channel.load now repopulates the entire state with the actions that 1 made, without any changes from 2
  • 2 reconnects, all of their edits are sent out to the server from syncSince
  • 1 receives these actions, but since the canonical timestamp of these actions is before the 1's channel.load event, when replayed in sequence, channel.load just overrides them and they never show up
  • 2 re-subscribes to the channel, channel.load repopulates the entire state with actions that both 1 and 2 have made

1 is now in a desynced state. 2 has parity with the database

4 replies