Commit graph

2783 commits

Author SHA1 Message Date
lin onetwo
e4e97fadd3 fix: minor issues 2025-10-30 04:08:49 +08:00
lin onetwo
2e23d5cf9e test: view might take longer to load 2025-10-30 03:48:16 +08:00
lin onetwo
4e6d1cff29 fix: prevent ipc echo change back to frontend 2025-10-30 03:45:42 +08:00
lin onetwo
a5bfb8d779 fix: when move file to subwiki, delete old file 2025-10-30 03:45:25 +08:00
lin onetwo
530e4c6e3c Revert "fix: prevent echo by exclude title"
This reverts commit 86aa838d24.
2025-10-30 02:42:45 +08:00
lin onetwo
e3747d7dbf test: Then file "Draft of '新条目'.tid" should not exist in "{tmpDir}/wiki/tiddlers" 2025-10-30 02:42:34 +08:00
lin onetwo
86aa838d24 fix: prevent echo by exclude title 2025-10-30 02:34:51 +08:00
lin onetwo
1c88aca19b Update view.ts 2025-10-30 02:13:13 +08:00
lin onetwo
d327343f4d Check if the WebContents is actually loaded and remove fake webContentsViewHelper.new.ts created by AI 2025-10-30 02:11:46 +08:00
lin onetwo
ae8724217f Optimize test steps and screenshot logic
Removed unnecessary short waits in filesystemPlugin.feature and increased wait time for tiddler state to settle. Updated application.ts to skip screenshots for wait steps, reducing redundant screenshots during test execution.
2025-10-30 00:04:25 +08:00
lin onetwo
bb7ae1adef test: use id to check view load and sse load 2025-10-29 23:09:54 +08:00
lin onetwo
da0e32ea87 Update filesystemPlugin.feature 2025-10-29 20:00:14 +08:00
lin onetwo
5bf3ef75fc fix: routing tw logger to file 2025-10-29 19:16:36 +08:00
lin onetwo
be85dcb358 Update filesystemPlugin.feature 2025-10-29 18:32:41 +08:00
lin onetwo
f35d2e8c33 fix: draft not move to sub 2025-10-29 16:09:03 +08:00
lin onetwo
c7b5c0e806 Update wiki.ts 2025-10-29 14:25:14 +08:00
lin onetwo
1221f89c6f remove log 2025-10-29 14:22:44 +08:00
lin onetwo
6af843c872 Update wiki.ts 2025-10-29 14:14:33 +08:00
lin onetwo
2e9936ce80
Update BACKOFF_OPTIONS with new configuration 2025-10-29 02:20:19 +08:00
lin onetwo
a3f3f5e3e7
Implement backoff for file existence check
Refactor file existence check to use backoff strategy and add directory tree retrieval for error reporting.
2025-10-29 02:08:17 +08:00
lin onetwo
2000bb2743 lint 2025-10-29 01:50:01 +08:00
lin onetwo
063af34a7e Update Sync.timezone.test.ts 2025-10-29 01:49:05 +08:00
lin onetwo
ae5fac1642 fix: potential symlinks problem of subwiki 2025-10-29 01:39:52 +08:00
lin onetwo
9faea68ed9 Update index.tsx 2025-10-29 01:30:12 +08:00
lin onetwo
f615f9f168 i18n for notification 2025-10-29 01:26:48 +08:00
lin onetwo
347946a3bb Fix sync interval timezone handling and add tests
Refactored syncDebounceInterval logic in Sync.tsx to be timezone-independent, ensuring correct interval storage and display across all timezones. Added comprehensive tests in Sync.timezone.test.ts to verify correct behavior and document previous timezone-related bugs. fixes #310
2025-10-29 01:06:22 +08:00
lin onetwo
4e4ba11035 Update filesystemPlugin.feature 2025-10-29 00:57:59 +08:00
lin onetwo
b6fcd4a6db rename camelcase 2025-10-29 00:57:57 +08:00
lin onetwo
46d646df46 Update watch-filesystem-adaptor.ts 2025-10-29 00:50:43 +08:00
lin onetwo
0899cf83f6 feat: deboucne and prevent data race when write file 2025-10-29 00:49:12 +08:00
lin onetwo
2c654305b3 Refactor sync echo prevention and improve logging
Removed frontend-side echo prevention logic in ipcSyncAdaptor, relying solely on backend file exclusion for echo prevention. Improved console log wrappers to preserve native behavior and added a log statement to setupSSE. Updated test steps and file modification logic to better simulate external edits without modifying timestamps. Added internal documentation on sync architecture.
2025-10-29 00:34:28 +08:00
lin onetwo
a79fd01468 auto reload view and click subwiki icon 2025-10-28 21:36:25 +08:00
lin onetwo
7a4b860972 Update wiki.ts 2025-10-28 21:20:39 +08:00
lin onetwo
e1aedc1220 fix 2025-10-28 21:11:24 +08:00
lin onetwo
7b8e0c3862 fix: error on frontend loading worker thread 2025-10-28 20:37:05 +08:00
lin onetwo
4a517e6719 Revert "AI added waitForSSEReady"
This reverts commit 983b1c623c.
2025-10-28 20:02:14 +08:00
lin onetwo
983b1c623c AI added waitForSSEReady 2025-10-28 20:02:10 +08:00
lin onetwo
eff293e073 feat: monitoring subwiki 2025-10-28 20:01:41 +08:00
lin onetwo
c95076e332 fix: step that is wrong 2025-10-28 17:18:44 +08:00
lin onetwo
be4b566305 fix: Return false on sync failure - no successful changes were made
fixes #558
2025-10-28 13:52:50 +08:00
lin onetwo
cada5ee861 fix: sometimes change sync interval not working
fixes #310
2025-10-28 13:50:55 +08:00
lin onetwo
597f788f29 feat: Skip restart if file system watch is enabled - the watcher will handle file changes automatically 2025-10-28 13:44:06 +08:00
lin onetwo
7473612cec v0.13.0-prerelease3 2025-10-28 13:29:04 +08:00
lin onetwo
9a6f3480f5
Feat/watch fs (#649)
* Add watch-filesystem-adaptor plugin and worker IPC

Introduces the watch-filesystem-adaptor TiddlyWiki plugin, enabling tag-based routing of tiddlers to sub-wikis by querying workspace info via worker thread IPC. Adds workerServiceCaller utility for worker-to-main service calls, updates workerAdapter and bindServiceAndProxy to support explicit service registration for workers, and documents the new IPC architecture. Updates wikiWorker and startNodeJSWiki to preload workspace ID and load the new plugin. Also updates the plugin build script to compile and copy the new plugin.

* test: wiki operation steps

* Add per-wiki labeled logging and console hijack

Introduces labeled loggers for each wiki, writing logs to separate files. Adds a logFor method to NativeService for logging with labels, updates interfaces, and hijacks worker thread console methods to redirect logs to main process for wiki-specific logging. Refactors workspaceID usage to workspace object for improved context.

* Update log handling for wiki worker and tests

Enhanced logging tests to check all log files, including wiki logs. Adjusted logger to write wiki worker logs to the main log directory. Updated e2e app script comment for correct usage.

* Enable worker thread access to main process services

Introduces a proxy system allowing worker threads to call main process services with full type safety and observable support. Adds worker-side service proxy creation, auto-attaches proxies to global.service, and updates service registration to use IPC descriptors. Documentation is added for usage and architecture.

* Update ErrorDuringStart.md

* chore: upgrade ipc cat and allow clean vite cache

* Refactor wiki worker initialization and service readiness

Moved wiki worker implementation from wikiWorker.ts to wikiWorker/index.ts and deleted the old file. Added servicesReady.ts to manage worker service readiness and callbacks, and integrated notifyServicesReady into the worker lifecycle. Updated console hijack logic to wait for service readiness before hijacking. Improved worker management in Wiki service to support detaching workers and notifying readiness.

* Refactor wiki logging to use centralized logger

Removed per-wiki loggers and console hijacking in favor of a single labeled logger. All wiki logs, including errors, are now written to a unified log file. Updated worker and service code to route logs through the main logger and removed obsolete log file naming and management logic.

* fix: ipc cat log error

* Refactor wiki test paths and improve file save logic

Updated test step to use wikiTestRootPath for directory replacements and added wikiTestRootPath to paths.ts for clarity. Improved error handling and directory logic in watch-filesystem-adaptor.ts, including saving tiddlers directly to sub-wiki folders, more informative logging, and ensuring cleanup after file writes is properly awaited.

* rename

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* feat: basic watch-fs

* feat: check file not exist

* refactor: use exponential-backoff

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* Initial commit when init a new git.

* fix: cleanup

* Refactor test setup and cleanup to separate file

Moved Before and After hooks from application.ts to a new cleanup.ts file for better organization and separation of concerns. Also removed unused imports and related code from application.ts. Minor type simplification in agent.ts for row parsing.

* test: modify and rename

* feat: enableFileSystemWatch

* refactor: unused utils.ts

* Update watch-filesystem-adaptor.ts

* refactor: use node-sentinel-file-watcher

* refactor: extract to two classes

* The logFor method lacks JSDoc describing the level parameter's

* Update startNodeJSWiki.ts

* fix: napi build

* Update electron-rebuild command in workflows

Changed the electron-rebuild command in release and test GitHub Actions workflows to use a comma-separated list for native modules instead of multiple -w flags. This simplifies the rebuild step for better-sqlite3 and nsfw modules.

* lint

* not build nsfw, try use prebuild

* Update package.json

* Update workerAdapter.ts

* remove subWikiPlugin.ts as we use new filesystem adaptor that supports tag based sub wiki

* fix: build

* fix: wrong type

* lint

* remove `act(...)` warnings

* uninstall chokidar

* refactor and test

* lint

* remove unused logic, as we already use ipc syncadaptor, not afriad of wiki status change

* Update translation.json

* test: increast timeout in CI

* Update application.ts

* fix: AI's wrong cleanup logic hidden by as unknown as

* fix: AI's wrong  as unknown as

* Update agent.feature

* Update wikiSearchPlugin.ts

* fix: A dynamic import callback was not specified.
2025-10-28 13:25:46 +08:00
lin onetwo
ea78df0ab3
Fix: security errors (#648)
* refactor: outdated usage

* fix: use JSON.stringify to prevent '`' break the string to execute any script

* fix: use json5 parse LLM tool calling

* fix  Potential file system race condition

* fix  Indirect uncontrolled command line

* Update callImageGenerationAPI.ts

* While the shell path is now validated, arguments_.join(' ') could still contain shell metacharacters that enable command injection. The arguments array should be validated or passed in a way that prevents shell interpretation, such as using the array form of execSync instead of string interpolation.

* directly Remove TiddlyWiki special characters that could cause parsing issues

* prevent race condition

* fix: subscribe to latest pauseNotification

* Return a lightweight mock notification object to avoid creating real browser notifications

* Update responsePatternUtility.ts
2025-10-24 22:16:03 +08:00
lin onetwo
69cc703b18
Add master branch to CodeQL workflow triggers 2025-10-24 17:39:18 +08:00
lin onetwo
2cbd2c8145
Rename codeql-analysis.yml to codeql.yml 2025-10-24 17:38:08 +08:00
lin onetwo
6700c62243
test: codeql for wikioperation (#647)
* test: codeql for wikioperation

* test: codeql not find suite

* Move CodeQL analysis to dedicated workflow

Extracted the CodeQL security analysis job from test.yml into a new codeql-analysis.yml workflow file for better separation of concerns and maintainability.

* Update codeql-analysis.yml

* de

* 。
2025-10-24 16:40:32 +08:00
lin onetwo
47a0c93cfe v0.13.0-prerelease2 2025-10-24 01:24:41 +08:00
lin onetwo
9ea05852c4 fix: forget to rebuild binary in release mode. Prevously only in test mode 2025-10-24 01:24:37 +08:00