Skip to content

feat: add app data reset flow - #13

Merged
hhhjin merged 2 commits into
mainfrom
codex/add-app-data-reset
Mar 18, 2026
Merged

hhhjin merged 2 commits into
mainfrom
codex/add-app-data-reset

Conversation

@hhhjin

@hhhjin hhhjin commented Mar 18, 2026

Copy link
Copy Markdown
Member

Summary

  • add a confirmed syncdown reset --yes CLI command and document it across the README and docs translations
  • implement app data reset in core, including sqlite store disposal and removal of config, state, secrets, master key, and lock files while preserving synced Markdown output
  • expose Reset app data from the TUI Advanced menu with confirmation and coverage for the new reset behavior

Testing

  • bun run lint:fix
  • bun run test
  • bun run build

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a robust and user-friendly mechanism for resetting local application data in syncdown. It provides both a command-line interface and a Text User Interface option to clear configuration, state, and sensitive credentials, while carefully preserving user-generated synced Markdown files. The implementation includes necessary safeguards like explicit confirmation and checks for ongoing sync operations, enhancing data management and application stability.

Highlights

  • New syncdown reset --yes CLI Command: Introduced a new command-line interface command syncdown reset --yes that allows users to delete local application data, including configuration, state, secrets, master key, and lock files. This command requires explicit confirmation via the --yes flag to prevent accidental data loss.
  • Core Application Data Reset Logic: Implemented the core logic for resetting application data, ensuring that critical files like config.json, state.db, secrets.enc, master.key, and sync.lock are removed. Crucially, this reset operation preserves any synced Markdown output under the configured outputDir.
  • TUI Integration for App Data Reset: Integrated the app data reset functionality into the Text User Interface (TUI) via the Advanced menu. Users can now initiate a reset with a confirmation step. The TUI also prevents resetting data if a sync activity is currently running, providing a user-friendly safeguard.
  • State Store Disposal Mechanism: Added an optional dispose method to the StateStore interface and implemented it for the SQLite state store. This ensures that the database connection is properly closed before application data files are removed during a reset, preventing potential file access issues.
  • Updated Documentation and Tests: Comprehensive updates to the README.md and multi-language CLI documentation (cli.mdx, cli.ja.mdx, cli.ko.mdx, cli.zh-CN.mdx) to reflect the new syncdown reset --yes command. New unit tests were added for both the CLI and core application logic to ensure the reset functionality works as expected, including edge cases like active sync locks and argument validation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new syncdown reset command to clear local application data while preserving synced Markdown files. The feature is implemented in the core application, exposed through both the CLI with a --yes confirmation flag and the TUI's advanced menu with a confirmation step. The changes include comprehensive tests covering the new logic, including interactions with file systems, state disposal, and run locks. Documentation across all supported languages has been updated accordingly. The implementation is robust, with safety checks to prevent data loss during active sync operations. I have one minor suggestion to improve performance slightly.

Comment thread packages/core/src/app.ts Outdated
@hhhjin
hhhjin merged commit 4314c07 into main Mar 18, 2026
1 check passed
@hhhjin
hhhjin deleted the codex/add-app-data-reset branch March 18, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant