ai on main
Add equals sign (#92) (compare)
ai on main
Update dependencies (compare)
ai on main
Update README.md (#91) (compare)
ai on main
Fix nano-staged config (compare)
ai on main
Update CI, dependencies and lin… (compare)
ai on main
Update CI config (compare)
ai on main
Update dependencies (compare)
ai on main
Fix spelling check (compare)
ai on main
Promote Vite instead of Parcel Update dependencies (compare)
ai on main
Fix remark plugins (compare)
ai on main
Update dependencies Add ignore-scripts to yarn in D… Move from Yarn to pnpm (compare)
ai on main
Adds recipe about deployment (#… (compare)
Hello,
I want to use Logux at work and I have some questions about the best practices.
Up until now I played with Logux testing various scenarios, but now I want to use it for real.
My usecase:
I have a list of car stores that's displayed in the screen (paginated, sortable, filterable).
The list is populated at first via Excel File Upload.
After that you can retrieve all stores, change various fileds of a store, delete one, delete all.
My Questions:
Hello. First off, amazing project. The entire offline-first, optimistic UI approach is, frankly, awe-inspiring.
I have a question regarding your suggestion for server-side actions from a few days ago. This one:
async load (ctx) {
let messages = db.findMessages({ room: ctx.id })
return messages.map(i => [{ type: 'message', text: i.text, authorId: i.authorId, room: i.room }, { time: i.createdAt }])
}
I've added something similar to my project, but the problem is that the ordering of actions with identical timestamps is non-deterministic. Reloading the client multiple times produces different results.
I believe it's because Logux server processes each of the returned messages asynchronously, and the logical timestamps for the same createdAt
are assigned in whatever order the promises happen to execute.
Do you have any idea how I can have same-timestamp messages preserve ordering when reloading? I've tried setting meta.id
of the original client for returned messages (since it includes the counter), but that made the original client ignore the messages on reload.
in response to the thread above:
all other clients produce normal debug, something like:
Logux added map/editMap action
index.js:25 Action {type: "map/editMap", payload: {…}}
index.js:25 Meta {id: "1592942048725 clientIdTodo:WBhtspbq:yc8TcHMd 0", time: 1592942048725, reasons: Array(1), added: 2}
index.js:23 From: clientIdTodo:WBhtspbq:yc8TcHMd
the original client sees this:
Logux action 1592942048725 clientIdTodo:WBhtspbq:yc8TcHMd 0 was processed
so just the ID
@ai I'm trying to understand the async/sync nature of server.type( 'SOME_ACTION1', { process()... }
calls on the Logux Server.
I've tried async process(){ await dbUpdate() }
however 'SOME_ACTION2 -> process()
is called before 'SOME_ACTION1' -> process()
completes.
I'm only looking for clarification, not reporting an issue or wanting anything changed. If I'm correct and actions fire asynchronously and can't be made synchronous then I need to queue them up so that I can process them in order and to completion.
quick question.
On a Java Sever using Logux Proxy:
Token is not sent with all Actions, only with Auth command once?
When Proxy calls our stateless Rest Backend with an Action (like subscribe, or custom action) how do we know the authentication took place fine?
ps: I'm using Logux Vuex, do I need to manually add the token to each commit.sync( call?
but what about the subscribe, which is done automatically from the loguxMixin
Hello, basic usecase (Logux Vuex, Logux Proxy, Java Spring Boot Rest Backend):
ps: I know that a better approach would have been to set the UUID in Vuex, so the RESEND action would have taken care of all this,
but is there a best practice for my scenario?
isSubscribing
key, but it's key to wait when an application will connect to a some channel
the client terminal tab says:
```Compiled successfully!
You can now view client-logux in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.11.5:3000```
but nothing displays on the local address. It only displays on the 'on your network' address which seems odd too.
It would be great if logux/undo
included the failed action
that is being undone. I understand from https://logux.io/guide/concepts/action/#system-actions that:
action.id will be equal to meta.id of reverted action
however that means I need to keep a queue of added actions in order to find the id
and know what the action being undone was.
Or am I missing something here?
'logux/unsubscribe'
and then Client.changeUser( guestUserId, undefined )
.changeUser()
I get a "logux/subscribe"
with resubscribe: true
and the original user.dispatch.local()
looks like what you want. See: https://logux.io/recipes/cross-tab/
'login/done'
I assume client.changeUser( action.userId, action.token )
needs to called to change from anonymous
to the logged in user.logux/subscribe
the client
is in a incorrect state as it still has the anonymous
login which hasn't received alogux/sychronized
leaving setSynchronized()
in status()
never passing if (Object.keys(processing).length === 0)
because it has the anonymous
item still present. Apologies for the long winded explanation.client.destroy()
and then client.start()
with the logged in users credentials.
const Logux = createLogux({
subprotocol: config.subprotocol,
server: config.loguxProxy,
userId: someUserId
token: i-want-to-change-this-when-user-pushes-a-button
});