Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 21 17:58

    ai on main

    Clean up dependencies (compare)

  • Sep 28 20:35
    ai commented #89
  • Sep 28 18:01
    vitalybaev commented #89
  • Sep 28 17:26

    ai on main

    Updated example of Logux Server… (compare)

  • Sep 28 17:26
    ai closed #89
  • Sep 28 17:26
    ai commented #89
  • Sep 28 17:24
    vitalybaev opened #89
  • Sep 27 12:20

    dependabot[bot] on npm_and_yarn

    (compare)

  • Sep 27 12:20

    ai on main

    Bump ansi-regex from 5.0.0 to 5… (compare)

  • Sep 27 12:20
    ai closed #88
  • Sep 27 12:18
    dependabot[bot] labeled #88
  • Sep 27 12:18
    dependabot[bot] opened #88
  • Sep 27 12:18

    dependabot[bot] on npm_and_yarn

    Bump ansi-regex from 5.0.0 to 5… (compare)

  • Sep 27 12:18
    ai commented #87
  • Sep 27 12:18

    ai on main

    Change minimum Node.js version … (compare)

  • Sep 27 12:18
    ai closed #87
  • Sep 27 12:16
    vitalybaev opened #87
  • Sep 17 07:11
    ai transferred #86
  • Sep 17 07:06
    vitalybaev commented #86
  • Sep 17 03:26
    ai commented #86
Neville Franks
@getclibu_twitter

@ai The app I've been working on for ages no longer authenticates with the Logux Server. Everything was working fine yesterday and then it broke. I've gone back to an earlier set of code from a week ago and same issue. I've updated logux client & server and restarted Windows twice and same problem.

So far I can't work out why it's broken. I've tried FF, Edge and Chrome - same issue.

I almost suspect this was an issue waiting to happen, but going back to earlier code has the same problem. I'm not aware of a Windows update yesterday.

I'm just reaching out in case you happen to be aware of something breaking recently.

Neville Franks
@getclibu_twitter

Ok, I think I may have found the problem. Each User needs to have their own Logux Client Log. I need to create the CrossTabClient before I can talk to the server and get the Users ID etc. And I need the Users ID to identify the users IndexedDb store - new IndexedStore( userId ).

So I have a catch 22. ie. I need the userId to instantiate the CrossTabClient but don't have it yet.

I hope that makes sense.

Andrey Sitnik
@ai
I have no solution for this case right now
Neville Franks
@getclibu_twitter
Can I change the store once the user has been authenticated?
2 replies
Emilian Sorin Decianu
@aemilianvs
Hello :)
Trying to use redux with Vue but @logux/redux has the react peer dependency (uses createElement, useEffect hook from react, etc). This seems a bit counter-intuitive, to have logux/redux depend on react, which makes it impossible to use redux + logux + vue. Is there any hack I can use to make this work? Shouldn't logux/redux be more library independent and not couple with react, since redux can be used independently as well?
Thank you!
18 replies
Eduard Aksamitov
@euaaaio
All that you listed is part Vue and pure js helpers, not Vuex.
Eduard Aksamitov
@euaaaio
Cool 🤘🏻
Neville Franks
@getclibu_twitter

I have a number of scenarios where server.auth() can fail, other than incorrect credentials. For example a database issue. I need to report the specifics of the failure back to the client so the user has detailed info about the underlying issue. Is there any way to do this?

Related to this is the need to fail server.auth() otherwise the client will immediately start sending its Log to the server which can't be processed because of the database etc. issue. I can't see any way to prevent the client from sending it's log to the server once a connection + auth is established?

6 replies
Neville Franks
@getclibu_twitter

Is there a way for a CrossTabClient to find out if there are other CrossTabClient instances (Tabs) for the same client?

What I'm trying to find out is when does the last CrossTabClient close for a client, so that I can release resource for that client on the server.

Does the server need to keep track of each CrossTabClient instance and use server.on( 'disconnected' ) to see when they have all disconnected?

6 replies
Neville Franks
@getclibu_twitter
I have an issue CrossTabClient where I have two Tabs open to the same client. I Sign out of both Tabs which does CrossTabClient#destroy() in each Tab. Both Tabs are still open in the Browser.
Then when I sign in startElection() -> getLeader() returns a clientId from localStorage which can be the other Tab, in which case the Tab I'm signing in never becomes the leader and never connects to the server.
9 replies
cosminv6u
@cosminv6u
Question, does Logux work fine with React and MicroFrontends? Where you can't have a global Redux store, but one redux store per MicroFrontend. Any thoughts about MicroFrontends?
5 replies
Vladimir
@Vladimirb87
How I can correctly handle custom exceptions in my actions? I just get an error "Server undid Logux action because of error" with action logux/undo and reason "error" in action dispatch promise
7 replies
Neville Franks
@getclibu_twitter
I've updated logux server to 0.10.0 and I can no longer see how to specify cli arguments as mapArgs() in options-loader throws Error('Unknown argument ..' ).
ex. node js/index.js --dev thows re. --dev
6 replies
Neville Franks
@getclibu_twitter
I've updated from Node V15 to Node V16 for Logux as it engines spec doesn't include V15. Unfortunately I'm having issues with Parcel.js and Node v16 which I can't resolve at the moment. I briefly tried Vite but it had issues with Logux which I don't have time to investigate.
Is there any reason not to support Node V15?
4 replies
Neville Franks
@getclibu_twitter
I've spent most of the day working on https://gitter.im/logux/logux?at=60776a8d1f84d71853b9a092
My conclusion is when you have multiple tabs open then disconnect them onStorage() is still called after destroy() -> window.removeEventListener('storage', this.onStorage) has been called.
This in turn calls watchForLeader() -> startElection() even though all tabs are disconnected.
This in turn cycles through changing localStorage - leader value and then depending on where the cycle is connecting a Tab can see 'follower' and never connect to the server.
The solution to this needs someone with a better understanding of the code than I do.
4 replies
Neville Franks
@getclibu_twitter
Following on this is also manifesting with an issue on the server where both tabs have disconnected and the server is in a "connect" - "timeout" endless loop. ie.
LoguxError: A timeout was reached (20000 ms)
    at FilteredNode.syncError (file:///c:/webapps/clibuNotes/node_modules/@logux/core/base-node/index.js:225:15)
    at Timeout.<anonymous> (file:///c:/webapps/clibuNotes/node_modules/@logux/core/base-node/index.js:253:12)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7) {
  type: 'timeout',
  options: 20000,
  description: 'A timeout was reached (20000 ms)',
  received: false,
  connectionId: '31'
}
Ben Teichman
@effervescentia
Hi logux community! 🤘 I'm happy to have stumbled across your corner of the internet!
I am curious if there are any established patterns for "awareness" information, specifically for high-throughput information such as cursor location where the clients don't need to be notified of their action being distributed to other clients and no history state is required just applying a LWW algorithm
Ben Teichman
@effervescentia
Furthermore I'm waiting to hear back from the team currently but curious if anyone here has any details on the feature set that is available with the "pro" server? I'm guessing some sort of leader election / action re-broadcasting on server peers via redis based on one of the jsdoc comments for the Server options to allow for a setup with multiple servers for redundancy
2 replies
Neville Franks
@getclibu_twitter
Prior to Logux v0.10.0 we could specify a Server.loadOptions( .. { reporter: () => {} } to stop console output. With v0.10.0 reporter has changed to logger and so far I haven't found a way to stop this going to the console. How can I accomplish this?
4 replies
cosminv6u
@cosminv6u
Hi, I want to play a little bit with logux/state , is there any documentation or example I can use? I saw something in the readme on git, but seems not enough
4 replies
Brian Dombrowski
@bdombro
I've been messing around with Logux for a day and am having a really hard time just getting something working. Is there a complete, full-stack, react template or demo I could look at?
Brian Dombrowski
@bdombro

I've got most of it working except I can't get useFilter to work for the life of me. It just always returns an empty array and isEmpty = true.

Oh, and I couldn't figure out how to submit a mutation

Jeremy Dombrowski
@meatflavourdev
that's my last name!🤯
Brian Dombrowski
@bdombro
OMG!!!!!!!!! HI DUDE!
Jeremy Dombrowski
@meatflavourdev
haha 😜 We should go buy lotto tickets, it's that kind of day.
hmm looked around for an example... can you post ur useFilter code
Side note: I've changed the pronounciation back from the Westernized Dom-brow-ski to something more like Dom-brov-ski.. I think it sounds classy. 😂
Andrey Sitnik
@ai
@bdombro we are working on the example right now
Check out server log, does server return actions back to the client (with meta.clients).
Now, that we didn't add a guide for SyncMap and useFilter yet. You should use only examples in API
Brian Dombrowski
@bdombro
image.png
Ya we should! Here is a link to my WIP example -- https://github.com/bdombro/logux-react-demo/blob/main/client/src/Todos.tsx#L21
8 replies
Brian Dombrowski
@bdombro
Btw, have y'all thought about scalability yet? I was wondering how hard it would be to scale past a single server, and suspect it would be very hard due to the websockets and server-centralized diff engine
9 replies
Evgeny Zaytsev
@z4o4z

Hi there, I'm new to logux and have a question. Is there a way to send data to the client when the action is processed?

f.e. I have a create entity action, the server process the action, creates an entity in the DB, broadcasts entity created action to all connected clients. But also I want to send the new entity back to the action sender client to redirect it onto the new entity page. Any ideas?

Andrey Sitnik
@ai
@z4o4z by default, Logux Server already send logux/processed action when client’s action was processed
If you need another action (for instance, to send back some data) use ctx.sendBack(action, meta) (ctx is a first argument in server.type callbacks)
Evgeny Zaytsev
@z4o4z
hey @ai, yeah I've seen the logux/processed action and ctx.sendBackmethod, but is there any api/hack to get the data from the server process method in the client's .sync result? I know that it's possible to send back to the client a new action with the created entity, I can even add the original action id to the new action to wait this action on the client. But this looks a bit dirty...
Zoso der Goldene
@ZosoDerGoldene
Hi there, also new to Logux and enjoying the ride so far (the documentation might be reworked a bit for newcomers & typescript, I'll write something up as soon as I'm a bit farther on the learning curve). I came across an issue, though, and don't know how to debug it further. I'm building a React/Redux/Logux/Prisma app, and I'm trying to add the useAuth() hook. I don't have conflicting versions of React (17.0.2 everywhere) or React and the rendered, I don't violate the Rules of Hooks (call it top level, function component, first thing, etc.):
function Login() {
let {isAuthenticated, userId} = useAuth()
console.log(isAuthenticated)
and still, I get an "Invalid Hook Call" - as this only happens with the useAuth() Hook and not others - any way to investigate this further?
45 replies
Zoso der Goldene
@ZosoDerGoldene
Hello again, everything's working for me now. I stumbled upon a minor issue, though, that I seem unable to debug. When I use IndexedStore, the order parameter in calls to client.log.store.get() is no longer optional, and I get a TypeError: (destructured parameter) is undefined. From all the code, it should be optional, but it isn't and WebStorm arrives at the conclusion that it isn't, although I don't know how it does. I can reproduce this in JS as well. And it's not an issue with MemoryStore... Not a major issue, mind, just very odd.
4 replies
Michael Floering
@floering:matrix.org
[m]
quick question - does anybody know if logux "just works" in a browser extension? (i.e. using sendMessage)
(i'm testing this myself, but asking in the meantime 🙂)
Jeremy Dombrowski
@meatflavourdev

quick question - does anybody know if logux "just works" in a browser extension? (i.e. using sendMessage)

Not too familiar, but I'd check out
https://logux.io/web-api/#crosstabclient

Then you can just listen for messages and in the handler add them to the log(?)

client.log.add({ type: 'logux/subscribe', channel: 'users/14' }, { sync: true })
client.log.add({ type: 'logux/unsubscribe', channel: 'users/14' }, { sync: true })
"IndexedStore to store Logux log in IndexedDB" sounds handy.
https://github.com/logux/client
Michael Floering
@floering:matrix.org
[m]
@meatflavourdev: 👍️ thank you for the tips!
Michael Floering
@floering:matrix.org
[m]
have a question about nanostores, since it was a renaming from logux/state
Michael Floering
@floering:matrix.org
[m]

if i'm using CrossTabClient from @logux/client, with IndexedStore, and i've installed using the command npm install @logux/core @logux/client nanostores ... is it good/bad/ugly to use nanostores as well? it feels like a smell if i use it directly, if i try to have my authoritative state live in Logux (CrossTabClient, IndexedStore), but also have separate usage of nanostores.

but i'm using Svelte, and the nanostores README makes a lot of sense to me. so i'm trying to figure out - can I use nanostores the way it's outlined in the nanostores README, but use it together with CrossTabClient?

3 replies
Michael Floering
@floering:matrix.org
[m]
Cool, makes sense to me. Thank you much!
Dominik Picker
@DaDom
Hi!
I have a question about executing actions in batch:
Imagine I would like to dispatch multiple actions in one go, and those might even be a mix of local and sync. The regular batch util coming with react-redux does not really help with that. And it seems to me that when dispatching all actions just one by one (without await), there is a lot of time-travel going on.
Is there a recommended way how to handle that?
9 replies
Jules ➐
@legarsjules_twitter
Hello, I would like to use logux with nanostores like app state manager. I would like to know if I need to implement time travel system when receive undo or if an implementation like for redux or vuex was developed ?
17 replies
Dominik Picker
@DaDom
Hi!
Is there a way to use encodings like gzip or brotli for the websocket communication?
If not, what would be the best place to inject something like that?
Thanks a lot!
4 replies