Repository navigation
Description
Hi Linkwarden team!
I'd like to propose a feature for reliable offline link creation and offer to help implement it.
Motivation
I self-host Linkwarden on a private home network, without exposing it to the Internet.
When I'm away from home, I can share a URL to the Linkwarden mobile app, but saving fails because my instance is unreachable.
I'd love to be able to save links locally and have them automatically synchronized when the server becomes reachable again.
This would also benefit users experiencing temporary connectivity issues, server downtime, or maintenance.
Proposed behavior
A user shares or creates a link.
The client persists the link payload in a local outbox.
It attempts the normal POST /api/v1/links.
On confirmed success, the entry is removed from the outbox.
On a temporary connectivity failure, the entry remains queued.
Synchronization is retried when the app resumes, connectivity changes, or background execution is available.
The UI clearly distinguishes pending, synchronized, and failed entries.
The goal is reliable link creation, rather than expanding the existing offline reading functionality.
Possible implementation
Looking at the current codebase, I believe we could build on:
apps/mobile/app/incoming.tsx — Share Sheet handling.
packages/router/links.tsx — existing link creation logic.
apps/mobile/lib/offlineSync.ts — connectivity monitoring and synchronization lifecycle.
The mobile application's existing local persistence infrastructure.
I'd suggest a dedicated persistent outbox, potentially backed by SQLite, with a small synchronization worker.
I'd initially limit the scope to creating links in the mobile application, rather than attempting to make all operations offline-capable.
Duplicate prevention
One edge case worth discussing is when the server successfully creates a link but the client loses connectivity before receiving the response.
A subsequent retry could create a duplicate.
An optional server-side Idempotency-Key mechanism might be a robust long-term solution, although it could be implemented separately from the initial mobile outbox.
I'd appreciate your thoughts on whether idempotency should be addressed in the initial implementation.
Browser extension
Eventually, a similar persistent outbox could be implemented in the official browser extension.
However, I'd suggest keeping that as a separate contribution.
Willing to contribute
I'd be happy to work on implementing this feature and submit a pull request.
Before starting, I'd appreciate feedback on:
Does this feature align with Linkwarden's roadmap?
Would a dedicated SQLite-backed outbox be appropriate for the mobile client?
Would you prefer a mobile-only initial PR?
How would you approach idempotency and duplicate prevention?
I also came across a similar request in the LinkDroid project, which suggests this use case may be relevant to other self-hosted users:
Dacid99/LinkDroid-for-Linkwarden#31
Thanks for considering this! I'd be happy to discuss the architecture and adjust the implementation to fit the project's conventions.
Best Regards,
Bartek
Activity