421 Commits

Author SHA1 Message Date
vorotamoroz
a937feed3f Merge pull request #833 from rewse/fix/cli-sync-locked-error-message
fix(cli): show actionable error when sync fails due to locked remote DB
2026-03-28 23:58:34 +09:00
vorotamoroz
a0af6201a5 - No longer Peer-to-Peer Sync is not enabled. We cannot open a new connection. error occurs when we have not enabled P2P sync and are not expected to use it (#830). 2026-03-26 13:13:27 +01:00
Shibata, Tats
e01f7f4d92 test(cli): add TODO comment and locked-remote-DB test script
- Add inline TODO comment in runCommand.ts about standardising
  replication failure cause identification logic.
- Add test-sync-locked-remote-linux.sh that verifies:
  1. sync succeeds when the remote milestone is not locked.
  2. sync fails with an actionable error when the remote milestone
     has locked=true and accepted_nodes is empty.
2026-03-26 00:58:51 +09:00
Shibata, Tats
985004bc0e fix(cli): show actionable error when sync fails due to locked remote DB
When the remote database is locked and the CLI device is not in the
accepted_nodes list, openReplication returns false with no CLI-specific
guidance. The existing log message ('Fetch rebuilt DB, explicit
unlocking or chunk clean-up is required') is aimed at the Obsidian
plugin UI.

Check the replicator's remoteLockedAndDeviceNotAccepted flag after
sync failure and print a clear message directing the user to unlock
from the Obsidian plugin.

Ref: #832
2026-03-22 12:37:17 +09:00
Shibata, Tats
967a78d657 fix(cli): handle incomplete localStorage in Node.js v25+
Node.js v25 provides a built-in localStorage on globalThis, but without
`--localstorage-file` it is an empty object lacking getItem/setItem.
The existing check `!("localStorage" in globalThis)` passes, so the
polyfill is skipped and the CLI crashes with:

  TypeError: localStorage.getItem is not a function

Check for getItem as well so the polyfill is applied when the native
implementation is incomplete.
2026-03-22 11:57:47 +09:00
vorotamoroz
2ff60dd5ac Add missed files 2026-03-18 12:20:52 +01:00
vorotamoroz
c2bfaeb5a9 Fixed: wrong import 2026-03-18 12:03:51 +01:00
vorotamoroz
3a29818612 - Delete items which are no longer used that might cause potential problems
- Fix Some Imports
- Fix floating promises on tests
2026-03-18 11:54:22 +01:00
vorotamoroz
ee69085830 Fixed: Some buttons on the setting dialogue now respond correctly again (#827). 2026-03-18 11:51:52 +01:00
vorotamoroz
3963f7c971 Refactored: P2P replicator has been refactored to be a little roust and easier to understand. 2026-03-18 11:49:41 +01:00
vorotamoroz
602fcef949 - Fixed the issue where the detail level was not being applied in the log pane.
- Pop-ups are now shown.
- Add coverage for test.
- Pop-ups are now shown in the web app as well.
2026-03-18 11:48:31 +01:00
vorotamoroz
075d260fdd Fixed:
- Fixed the corrupted display of the help message.
- Remove some unnecessary codes.
2026-03-18 11:46:52 +01:00
vorotamoroz
1f87a9fd3d port setupManager, setupProtocol to serviceFeature
remove styles on webapp UI, and add stylesheet
2026-03-17 19:58:12 +09:00
vorotamoroz
fdd3a3aecb Add: vaultSelector (webapp) 2026-03-17 19:51:04 +09:00
vorotamoroz
6c69547cef ### Fixed
- Fixed flaky timing issues in P2P synchronisation.
- Fixed more binary file handling issues in CLI.

### Tests

- Rewrite P2P end-to-end tests to use the CLI as host.
2026-03-16 00:48:22 +09:00
vorotamoroz
89bf0488c3 Refactor: More refactor P2P Replicator 2026-03-15 04:07:47 +09:00
vorotamoroz
653cf8dfbe Refactor: Refactor P2P Replicator 2026-03-15 03:33:03 +09:00
vorotamoroz
9dd479e597 Fix for an issue where conflicts cannot be resolved in Journal Sync
Remove unnecessary test calling in CLI
2026-03-14 16:51:30 +09:00
vorotamoroz
8cad4cdf80 Add workaround for my mac 2026-03-14 16:50:43 +09:00
vorotamoroz
beced219c7 Fix: exit code 2026-03-14 16:13:14 +09:00
vorotamoroz
dfe13b1abd Fixed:
- No longer unexpected `Unhandled Rejections` during P2P operations (waiting acceptance).
CLI new features
- P2P sync has been implemented.
2026-03-14 15:08:31 +09:00
vorotamoroz
bf93bddbdd Fix: prevent transfer twice. 2026-03-13 23:34:38 +09:00
vorotamoroz
338a9ba9fa Add: mirror command
Tidy: test
2026-03-13 18:01:38 +09:00
vorotamoroz
29ce9a5df4 remove todo 2026-03-12 12:45:39 +01:00
vorotamoroz
d45f41500a Fix: no longer duplicated addLog setHandler 2026-03-12 12:27:47 +01:00
vorotamoroz
ad0a6b458f bump 2026-03-12 12:16:00 +01:00
vorotamoroz
84110aee97 update readme 2026-03-12 19:46:52 +09:00
vorotamoroz
822d957976 Refactor: separate entrypoint and main,
Fix: readlng binary file
2026-03-12 19:41:10 +09:00
vorotamoroz
d4aedf59f3 A- Add more tests.
- Object Storage support has also been confirmed (and fixed) in CLI.
2026-03-12 18:20:55 +09:00
vorotamoroz
5d80258a77 Add e2e-test (not passed yet)
Refine readme
2026-03-12 12:20:39 +09:00
vorotamoroz
fa14531599 Add note 2026-03-12 03:03:03 +09:00
vorotamoroz
7992b3c2b9 Wrote the test (but untested) 2026-03-12 03:01:46 +09:00
vorotamoroz
5872cad1e5 Implement commands 2026-03-12 02:56:30 +09:00
vorotamoroz
16c0dfef4c Remove the grandiloquence from the note written in work in progress. 2026-03-11 23:51:35 +09:00
vorotamoroz
4a0d5e99d0 Fix import path and add readme 2026-03-11 14:57:36 +01:00
vorotamoroz
0742773e1e Add self-hosted-livesync-cli to src/apps/cli as a headless, and a dedicated version. 2026-03-11 14:51:01 +01:00
vorotamoroz
2f8bc4fef2 - Now useOfflineScanner, useCheckRemoteSize, and useRedFlagFeatures are set from main.ts, instead of LiveSyncBaseCore. 2026-03-11 14:44:37 +01:00
vorotamoroz
0dfd42259d 11th March, 2026
Now, Self-hosted LiveSync has finally begun to be split into the Self-hosted LiveSync plugin for Obsidian, and a properly abstracted version of it.
This may not offer much benefit to Obsidian plugin users, or might even cause a slight inconvenience, but I believe it will certainly help improve testability and make the ecosystem better.
However, I do not see the point in putting something with little benefit into beta, so I am handling this on the alpha branch. I would actually preferred to create an R&D branch, but I was not keen on the ampersand, and I feel it will eventually become a proper beta anyway.

### Refactored

- Separated `ObsidianLiveSyncPlugin` into `ObsidianLiveSyncPlugin` and `LiveSyncBaseCore`.
- Now `LiveSyncCore` indicates the type specified version of `LiveSyncBaseCore`.
- Referencing `plugin.xxx` has been rewritten to referencing the corresponding service or `core.xxx`.

### Internal API changes

- Storage Access APIs are now yielding Promises. This is to allow more limited storage platforms to be supported.

### R&D

- Browser-version of Self-hosted LiveSync is now in development. This is not intended for public use now, but I will eventually make it available for testing.
- We can see the code in `src/apps/webapp` for the browser version.
2026-03-11 05:47:00 +01:00
vorotamoroz
f7dba6854f ### Fixed
- No longer unexpected deletion-propagation occurs when the parent directory is not empty (#813).

### Revert reversions
- Reverted the reversion of ModuleCheckRemoteSize. Now it is back to the service feature.
2026-03-09 10:24:49 +09:00
vorotamoroz
79bb5e1c77 ### Reverted
- Reverted to ModuleRedFlag and ModuleInitializerFile to the previous version because of some unexpected issues. (#813)
2026-03-07 18:36:10 +09:00
vorotamoroz
7ff9c666ce Fix: No more credentials logged 2026-03-03 13:34:18 +00:00
vorotamoroz
cf9d2720ce ### Fixed
- No longer deleted files are not clickable in the Global History pane.
- Diff view now uses more specific classes (#803).
- A message of configuration mismatching slightly added for better understanding.
    - Now it says `When replication is initiated manually via the command palette or ribbon, a dialogue box will open to address this.` to make it clear that the user can fix the issue by themselves.

### Refactored

- `ModuleRedFlag` has been refactored to `serviceFeatures/redFlag` and also tested.
- `ModuleInitializerFile` has been refactored to `lib/serviceFeatures/offlineScanner` and also tested.
2026-03-03 13:19:22 +00:00
vorotamoroz
f3e83d4045 Refactored: changed the implementation from using overrides to injecting an adapter. 2026-03-02 09:06:23 +00:00
vorotamoroz
e08fbbd223 ### Fixed and refactored
- Fixed the inexplicable behaviour when retrieving chunks from the network.
    - Chunk manager has been layered to responsible its own areas and duties. e.g., `DatabaseWriteLayer`, `DatabaseReadLayer`, `NetworkLayer`, `CacheLayer`,and `ArrivalWaitLayer`.
        - All layers have test now!
        - `LayeredChunkManager` has been implemented to manage these layers. Also tested.
    - `EntryManager` has been mostly rewritten, and also tested.

- Now we can configure `Never warn` for remote storage size notification, again.
2026-02-27 11:00:30 +00:00
vorotamoroz
646f8af680 ### Fixed
- Unexpected errors no longer occurred when the plug-in was unloaded.
- Hidden File Sync now respects selectors.
- Registering protocol-handlers now works safely without causing unexpected errors.

### Refactored
- LiveSyncManagers has now explicit dependencies.
- LiveSyncLocalDB is now responsible for LiveSyncManagers, not accepting the managers as dependencies.
    - This is to avoid circular dependencies and clarify the ownership of the managers.
- ChangeManager has been refactored. This had a potential issue, so something had been fixed, possibly.
- Some tests have been ported from Deno's test runner to Vitest to accumulate coverage.
2026-02-26 11:30:57 +00:00
vorotamoroz
392f76fd36 ### Refactored
- `ModuleCheckRemoteSize` has been ported to a serviceFeature, and also tests have been added.
- Some unnecessary things have been removed.
2026-02-26 08:59:54 +00:00
vorotamoroz
19c03ec8d8 ### Refactored
- `ModuleTargetFilter`, which was responsible for checking if a file is a target file, has been ported to a serviceFeature.
  - And also tests have been added. The middleware-style-power.
- `ModuleObsidianAPI` has been removed and implemented in `APIService` and `RemoteService`.
- Now `APIService` is responsible for the network-online-status, not `databaseService.managers.networkManager`.
2026-02-25 09:38:31 +00:00
vorotamoroz
c9a71e2076 fix: align dependency versions to main 2026-02-24 11:14:14 +00:00
vorotamoroz
6eec8117f5 Refactor: Constantising log-mark 2026-02-24 07:51:21 +00:00
vorotamoroz
9f6a909143 Merge remote-tracking branch 'origin/main' into beta to port #802 2026-02-24 07:44:18 +00:00