News for hackers. Stuff that matters.
Re:Why Local-First Apps Haven't Become Popular? by cyberax on Monday September 22, 2025 @08:16PM (#45341335)
We have a local-first app. Our approach?

Just ignore the conflicts. The last change wins.

No, really. In practice for most cases the conflicts are either trivial, or impossible. Trivial conflicts like two people modifying the same note are trivial for users, once you have a simple audit log.

And impossible conflicts are impossible to solve automatically anyway and require business processes around them. Example: two people starting to work on the same task in an offline-enabled task tracker.

Re:Why Local-First Apps Haven't Become Popular? by moggers123 on Monday September 22, 2025 @08:34PM (#45341464)
>Example: two people starting to work on the same task in an offline-enabled task tracker. Wouldn't this just mean both people are working on it?

I agree that this means humans intervening.. It sounds like there was a comms breakdown. But rather than doing a first-in-best-dressed, it sounds like accurately recording that both users are in fact working on the same thing is the best option since it surfaces that intervention is required (or maybe its intentional, tools insisting that only one person can work on an item at once annoys me). Sounds much better than quietly blowing away one of the user's changes.

In principle, local-first to me means each instance (and the actions each user carries out on their instance) is sacrosanct. Server's job is to collate it, not decide what the Truth is (by first-in-best-dressed or otherwise).

Re:Why Local-First Apps Haven't Become Popular? by cyberax on Monday September 22, 2025 @10:46PM (#45342259)
Sure. But then you need to notify users when they come back online that there's a conflict, so they can resolve what to do. You likely need to have a report on the frequency of such occasions for the managers, and so on.

These kinds of conflicts simply can not be solved by CRDTs or any other automated process. The application has to be designed around that.

> In principle, local-first to me means each instance (and the actions each user carries out on their instance) is sacrosanct. Server's job is to collate it, not decide what the Truth is (by first-in-best-dressed or otherwise).

This makes sense only for some applications, though.

And we have not yet started talking about permissions, access control, and other nice fun things.

Re:Why Local-First Apps Haven't Become Popular? by evelant on Tuesday September 23, 2025 @07:09AM (#45345380)
I’ve been experimenting with this, it’s a very interesting problem space!

https://github.com/evelant/synchrotron

Idea is to sync business logic calls instead of state. Let business logic resolve all conflicts client side. Logical clocks give consistent ordering. RLS gives permissions and access control. No dedicated conflict resolution logic necessary but still guarantees semantic consistency and maximally preserves user intentions. That’s the idea at least, requires more thought and hacking.

Re:Why Local-First Apps Haven't Become Popular? by moggers123 on Wednesday September 24, 2025 @02:45AM (#45357082)
I doubt you'll ever see this.. Oh well..

I probably should have been explicit in that I'm not arguing in favor of CRDTs, just that the adverse doesn't need to be "send it and accept the collateral".

Draw The Rest Of The Owl energy here, but at least its a nice northern star.

Re:Why Local-First Apps Haven't Become Popular? by kazinator on Monday September 22, 2025 @08:39PM (#45341504)
One solution is to make it so that people see their literal keystrokes in real time. Then they solve the conflict themselves. Like, "stop typing into this text because bob is typing into it".

It's like Ethernet conflict resolution: just access the shared medium and detect collisions in real time.

Re:Why Local-First Apps Haven't Become Popular? by avemg on Monday September 22, 2025 @10:11PM (#45342056)
How will you know that Bob is typing into it if you're offline?
Re:Why Local-First Apps Haven't Become Popular? by kazinator on Monday September 22, 2025 @10:16PM (#45342086)
That's a fair question; we here being under a submission aout local-first apps, and al.

Of course, you know the answer: if you're offline, you're not online. Bob gets to type whatever Bob wants, and until you go online, you don't get to overtype anything.

Re:Why Local-First Apps Haven't Become Popular? by ongy on Tuesday September 23, 2025 @01:12AM (#45343045)
But the offline enabled property allows exactly that.

Both sides type offline and only sync later. Neither would like their change to just be discarded.

Re:Why Local-First Apps Haven't Become Popular? by kazinator on Tuesday September 23, 2025 @01:43PM (#45350394)
I was responding only to the idea of having no conflict resolution: last edit wins (proposedin a great grandparent comment):

https://news.ycombinator.com/item?id=45341335 "We have a local-first app. Our approach? Just ignore the conflicts. The last change wins."

if you can see the edits being made in real time, keystroke by keystroke, that pretty much solves that problem.

As for offline editing, either don't support it (then you're not local-anything obviously) or you can have some lame workflow like "the document was changed by another user ..."

Re:Why Local-First Apps Haven't Become Popular? by cyberax on Monday September 22, 2025 @10:43PM (#45342249)
It's fine if you're talking about a text editor or an Excel table. And it's one of the few cases where CRDTs make sense.

If you have a CRM-like application with a list of users? Not so much.

Re:Why Local-First Apps Haven't Become Popular? by sakesun on Monday September 22, 2025 @09:16PM (#45341738)
Just have audit log. No need to try solving every trivial cases. Make something useful.
Re:Why Local-First Apps Haven't Become Popular? by giancarlostoro on Tuesday September 23, 2025 @08:54AM (#45346365)
Wouldn't it be less of an issue if you track the change history, and let users pick a specific historical version? Then it doesn't matter who wins, the end-user can go in and change it. Version control is one of the best parts about Google Docs.
Re:Why Local-First Apps Haven't Become Popular? by kobieps on Tuesday September 23, 2025 @11:37AM (#45348569)
Who is the audience of your app? Is it an internal app for a company, or is it a public facing consumer app?
Re:Why Local-First Apps Haven't Become Popular? by cyberax on Tuesday September 23, 2025 @01:24PM (#45350168)
Public app used by professionals in the field, often with poor or no connectivity. Even having a local read-only copy of data is often helpful for them.
Re:Why Local-First Apps Haven't Become Popular? by kobieps on Tuesday September 23, 2025 @03:02PM (#45351336)
Cool. Yeah in my experience last-write-wins is sufficient for 95% of use cases, and if you add audit trails to help resolve any disputes it gets you to 98%