ai on next
Update dev practices (compare)
dependabot[bot] on npm_and_yarn
ai on main
Bump ini from 1.3.5 to 1.3.7 (#… (compare)
dependabot[bot] on npm_and_yarn
Bump ini from 1.3.5 to 1.3.7 B… (compare)
ai on next
Fix branch name (compare)
ai on next
Update dependencies (compare)
ai on master
ai on main
ai on next
Typo (compare)
ai on next
Use resend shortcut (compare)
ai on next
Use nameless single job (compare)
ai on next
FIx job name (compare)
ai on next
Update dependencies Add cache to CI (compare)
ai on next
Fix workflow format (compare)
ai on next
Clean up GitHub Action config (compare)
ai on next
Add 0/clean action docs (compare)
ai on next
Simplify docs Simplify another example (compare)
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.
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?
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:
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).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?
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();
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
cosminv6u
but I can't log in with github ... so i used gitlab
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?
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
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
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
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
LoguxError: Logux received an invalid credential error (bad credentials)
. It sends the same message if authentication fails.
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.
@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.
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.
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?