Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 12 01:26

    ai on next

    Update dev practices (compare)

  • Dec 11 2020 17:44

    dependabot[bot] on npm_and_yarn

    (compare)

  • Dec 11 2020 17:44

    ai on main

    Bump ini from 1.3.5 to 1.3.7 (#… (compare)

  • Dec 11 2020 17:44
    ai closed #79
  • Dec 11 2020 17:43
    dependabot[bot] labeled #79
  • Dec 11 2020 17:43
    dependabot[bot] opened #79
  • Dec 11 2020 17:43

    dependabot[bot] on npm_and_yarn

    Bump ini from 1.3.5 to 1.3.7 B… (compare)

  • Dec 01 2020 23:01

    ai on next

    Fix branch name (compare)

  • Dec 01 2020 01:11

    ai on next

    Update dependencies (compare)

  • Dec 01 2020 01:10

    ai on master

    (compare)

  • Dec 01 2020 01:09

    ai on main

    (compare)

  • Nov 17 2020 15:18

    ai on next

    Typo (compare)

  • Nov 08 2020 23:59

    ai on next

    Use resend shortcut (compare)

  • Nov 07 2020 15:05

    ai on next

    Use nameless single job (compare)

  • Nov 07 2020 15:05

    ai on next

    FIx job name (compare)

  • Nov 07 2020 15:04

    ai on next

    Update dependencies Add cache to CI (compare)

  • Nov 06 2020 13:03

    ai on next

    Fix workflow format (compare)

  • Nov 06 2020 01:22

    ai on next

    Clean up GitHub Action config (compare)

  • Oct 24 2020 06:18

    ai on next

    Add 0/clean action docs (compare)

  • Oct 24 2020 02:33

    ai on next

    Simplify docs Simplify another example (compare)

cosminv6u
@cosminv6u
It would be nice if you can give us a small guidance of what needs to be done. Right now we're using the documentation and we reverse engineer the JavaScript code, but it's a little bit hard for us.
I know we need to take care of each nodes time, put logs in order and so on. Maybe we can create on gitter a separate channel and have a longer discussion
7 replies
Maksim Semenov
@maksimsemenov
Hi, is it possible to change token on the logux client without changing user? Let's say I have an authentication token, that is about to expire, and I want to refresh it and replace it on logux client. I found only changeUser user method, that I might use, but I don't want to disconnect/reconnect, etc.
14 replies
Imad Bouziani
@imadbz
I am considering Logux for a production project. I have couple questions:
  1. What happens to the state if server crashes? How about actions that are not processed yet?
  2. How do you scale servers?
2 replies
Eduard Aksamitov
@euaaaio
  1. Server state is what you have in your database. Nothing more. And I think, after server crush, client will save all actions in the log, that will be processed after reconnection.
    “Logux is based on the offline-first idea. If the node is offline right now, new actions will wait for a connection in the node’s log. Offline is a standard mode for Logux application.”
cosminv6u
@cosminv6u
Hi, I created some tests to see how Logux resend actions to different browser instances. I used webdriver.io and for some reason I get some racing conditions. Some WD disconnect as well.
40 replies
My backend is NodeJs, I implemented increment and decrement (the Counter) example.
When I test it manually it works fine. When I run each testcase individually it works fine. But when I run all 8 test cases, sometimes they fail, always different, there's no rule.
cosminv6u
@cosminv6u
Is there a way to disconnect the client without losing the logs? I want to do some tests with offline mode. And I see Chrome doesn't disconnect the WS when set to offline mode.. there's a bug since 2014 for that
1 reply
cosminv6u
@cosminv6u
Hi again 😁 I was doing some tests with 2 browsers updating the same thing in offline mode. I was expecting LWW, but for some reason it seems that it matters who's getting online first, instead of the absolute order of the actions in time. Also when going online they don't have the same value..
43 replies

UseCase1: OK

B1 -> Logux
B2 = Logux
B1 OFF
B1 -> Logux2
B2 OFF
B2 -> Logux3
B1 ON
B2 ON
B1 = Logux3
B2 = Logux3

UseCase2: NOK

B1 -> Logux
B2 = Logux
B1 OFF
B1 -> Logux2
B2 OFF
B2 -> Logux3
B2 ON
B1 ON
B1 = Logux2 !NOK!
B2 = Logux3

Imad Bouziani
@imadbz

Hi , Technical question here, I wonder how you solved it before.

I am subscribing to a channel: users/:id, it might respond with the userData or deniedAccess or notFound.
In case I get the data, I can just show a loader until the data shows up in the frontend, however, how do I handle the other two cases since Logux only respond with a logux/undo event

I am new to CRDT architectures, I am sure its an obvious one but I couldn't think of a solution yet!

thanks a lot.

4 replies
asedsami
@asedsami
Hi I'm having a 'WS Error' which is seen only in development mode. I was wondering how can I catch that error in redux and let the user know that they're offline in production mode? thank you for any help you are able to provide.
4 replies
asedsami
@asedsami
Pouchdb uses Couchdb and there's no need to write server code like in logux(server.type) and the browser can connect to the Database directly which makes developing apps faster. but pouchdb does not resolve conflicts automatically and I don't wanna show the conflict to the user. I would also like to understand what's going on and have full control and that's the reason I'd like to implement the app in logux instead of pouchdb. say I create an Offline First Todo App. in two offline devices, I edit and change the title of the first todo, when they both go online, what should happen to the title? Is CRDT(and logux) the solution to this problem? 'likes/add' is an atomic action whereas 'likes/set' isn't, what could be the atomic action for editing text in a todo or in a note app?
11 replies
asedsami
@asedsami
In logux's Docs I found a missing comma. I couldn't edit and add the comma. I checked all document pages. in these four pages, the edit buttons don't link to the related markdown file: Redux API, Vuex API, Node API, Branding.
Maksim Semenov
@maksimsemenov

I'm trying to implement an optimistic update pattern with some store on the client. When I add an action to the logux, I apply this action to the store (I'm trying to use storeon). Then if the action fails, I receive a logux/undo action from the server. I'm trying to get this action from logux store and revert the changes in the store.

The problem is that, if I'm trying to listen for logux/undo in log.on('add') and use log.byId, the original action is no longer in log, because it was already cleared. So I can not use it to revert my changes in store.
When I'm trying to listen for logux/undo in log.on('preadd'), the logux/undo is fired only for the leading tab and is not fired in other tabs.

So what would be a canonical way to revert optimistic updates in multiple tabs?

8 replies
Alexey A. Zabaykalsky
@AlexQuidditch
Hi everyone! How can I use Logux to create connection between Node.js apps? No browser, only for servers.
4 replies
Maksim Semenov
@maksimsemenov
What will be the approach for implementing continuous deployment? How can I persist the server log during deployment? Is there any built-in solution? Is it a use case for Logux Pro?
4 replies
Maldaris
@Maldaris
I see Logux Pro being referenced in regard to scaling support, does that mean that Logux doesn't play well with Node.js' cluster native module?
3 replies
Matthew O'Riordan
@mattheworiordan_twitter
This project looks amazing, kudos to the evil martian team and contributors. Are there any plans in supporting other languages, specifically mobile targets like Android, iOS, .NET? I see you have defined Protocols in your docs (+1), however that's AFAICT defining the protocol, and how an SDKs would need to be implemented I assume is a very different task if no spec exists (i.e. replicating what exists is one thing, but keeping it in sync is extremely hard). What are your thoughts on this?
4 replies
Maksim Semenov
@maksimsemenov

I have a question about action processing on the server. We have access, resend and process callbacks. And resend is called before the process. I'm curious, what was the reasoning behind that?

The use case that I have in mind, is that if the process callback fails (error while saving to the database, or maybe an error in some API call), I will need to send an undo action to all notified clients and revert it on them. I think that in this use case, resending action after it was successfully processed might be more efficient and will require less work.

Also, a related use case is data validation. When using validation schema (like joi) it allows to validate incoming data and remove all unknown keys (sort of "sanitize" payload). And with the current order of callbacks, it is not clear where to put this validation:

  • If we put it in the access callback, then we have to somehow pass the sanitized payload to the process (passing it in ctx alongside the action seems wacky, but at the same mutating an action seems like a bad idea as well).
  • if we put it in process we might end up with a lot of validation exceptions and a little bit of hustle reverting this action on all clients.

So I wonder what are the author's thoughts on that?

3 replies
Honza
@hfnukal
Hi, Logux is great, i love it. ;) I am integrating Logux server as Nuxt module. It works, but I needed to skip bind-control-server. Sync wors using ws but I am not sure if I miss some features. Is it possible to map Logux to some uri (eg /logux) so it is not colide with other services?
3 replies
friesendrywall
@friesendrywall
A few things about nodjs server that aren’t clear to me.. #1 does logux_backend mean an express back end for example? I’d like to make this coexist with express. #2 can sockjs be used as a transport, or is there some equivalent I have missed? #3 how would I go about triggering an external event? For example, something that would trigger a resend event, like something that came in on rest or mqtt?
49 replies
Honza
@hfnukal
Dirty hack for running http:
import { Server } from '@logux/server';

// fake http to avoid Logux on server /
const fakehttp = { on: (event, cb) => console.log('FAKE HTTP: ', event, cb) };
const logux = new Server(
  Server.loadOptions(process, {
    subprotocol: '1.0.0',
    supports: '1.x',
    root: __dirname,
    fakehttp,
  }),
);
logux.ws = new WebSocket.Server({ noServer: true });
// hack to http
http.on('upgrade', (request, socket, head) => {
  logux.ws.handleUpgrade(request, socket, head, (ws) => {
    logux.ws.emit('connection', ws);
  });
});
// apply server module
logux.listen();
Cosmin Vacaroiu
@cosmin.vacaroiu_gitlab
Hi, I have a question regarding Logux Proxy. Inside the Proxy when a user is disconnected I see log INFO Client was disconnected at 2021-01-26 21:33:42 but there's no call from Proxy to Backend to inform that this happened. I need to do some cleanups on the Backend when a user disconnects. Is it possible? 10x
16 replies
ps: I'm cosminv6u but I can't log in with github ... so i used gitlab
Simon Lemieux
@simlmx

Hi! I'm very very new to logux (have only read the doc so far) but it looks awesome. I have a tricky use-case and I'm wondering if it fits logux. Basically I want my main server to have all the state, but hide some informations to clients, so the clients would have a different state. So I want client A to send an action to the server, but have the server send a different action to client B, one that hides the information I don't want client B to know about.

Is that something possible? If so how would I go about it? Send a new action in the action's "process" callback?

4 replies
Cosmin Vacaroiu
@cosmin.vacaroiu_gitlab

Hi, when using Vuex, is it true that when there's an UNDO (no matter on which fragment of the Vuex store), all actions from the Client Session are replayed (except the failed one) and similarly, when you Disconnect and Reconnect, all actions since the Client Session was created, are replayed?

ps: when I say Client Session: I mean when you access the page (via GET) or you do a refresh

3 replies
It's a little bit weird that if I have an UNDO on an action that on a certain fragment of the Vuex State, some other mutations on a fragment totally not related to the failed one, are called, only because that mutation was called during the Client Session
Yet by working like this, it seems to solve many complex scenarios rather easy
Simon Lemieux
@simlmx
Hi! Is there a way for the client to be notified that the authentication didn't work? I'm using createLoguxCreator({... user: ..., token:...}) and I want my client to be able to react to a wrong token being passed.
7 replies
Mezriss
@Mezriss
Hi, could someone explain the usecase for CrossTabClient? The difference I see between it and Client my very limited testing is that it isn't syncing with anything - server or other tabs. Why is this desirable?
12 replies
Max
@MaxNamazov
Hi. I'm trying to implement some chat functionality in my app using Logux. Currently, I can't come up with an idea of how to update a participants list when someone leaving the app. I think that the most obvious way should be listening to a disconnected event on the server and then send back some action to all channel members. But it looks like the event object doesn't contain information about client channels. Or maybe I'm missing something and there is another way of doing such things? Thanks in advance
5 replies
Oleg Ermakov
@ol-lo

Hello.

I'm trying to understand the subscription/resubscription logic.
Could you refine the moment about meta.channels on the client side. https://github.com/logux/client/blob/64c7e442de0e7ccca2372c68c8877d82960796f1/client/index.js#L136

How client can get channels from the server if server cuts all meta except pointed in ALLOWED_META? Cut on server side happens here https://github.com/logux/server/blob/90bde83d65a9efad731395b8ea6f74448933a4b0/server-client/index.js#L175

5 replies
Simon Lemieux
@simlmx

Hi! I have a high-level question.

Let's say I have an action with a slow "process" function. If that action is followed by a second action that is faster to "process", I could effectively see the effects of that second action before the first one, correct?

Since my redux client is processing the actions synchronously, this could mean that the (effective) order of actions could be different on the server and the client?

And this is what the following ticket is about, correct? logux/logux#54

65 replies
Julien Bernard
@jbernard-s4m
Hi, I have a performance issue with Vuex integration, we received elements stored in an array in a Vuex state. We received like hundred element every 1ms, we add each element into an array. This operation take a lot of time and more when the list is growing. I suspect that it caused by deepCopy inside replaceState in Vuex integration. When I stringified all items and store all strings in the array, the processing time is ok. Have you an idea why this method is so slower? And have you already eard about a similar issue ?
11 replies
Sergey Korolev
@zumkorn_twitter
Hi! Is there a way to somehow tell on the client that the Logux proxy (Rails or Django) is not available? Now logux sends the message: LoguxError: Logux received an invalid credential error (bad credentials). It sends the same message if authentication fails.
2 replies
Arian Zargaran
@arianzf_gitlab

Hi guys!
I am working on a project where we have this Main App that consumes a React Component's subtree from our own private Components Library. In a modular microfront-end kind-of way.

Just for extra clarification, the Components Lib exposes a subtree that will be consumed by the Main App. Each (the Main App and the Components Lib) have their own Redux store.

What we are trying to achieve here is having both Redux stores in sync (actually just some State slices), even-though both Stores are always working in the same Tab.

Is there any trade-offs for using Logux model? To me, each app will have its own Id and will communicate through Logux proxy. So, I feel it might work. But, since I heard Andrey many times talking just about cross-tab communication, I wanted to be 100% sure.

4 replies
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