Skip to content

Codex/standardize backup names errors - #27

Merged
viseshrp merged 3 commits into
mainfrom
codex/standardize-backup-names-errors
Feb 24, 2026
Merged

viseshrp merged 3 commits into
mainfrom
codex/standardize-backup-names-errors

Conversation

@viseshrp

Copy link
Copy Markdown
Owner

No description provided.

Why\n- Local JSON export and Google Drive backups used different filename conventions, which was confusing and made it harder to reason about backup lists.\n\nWhat\n- Add shared helper (entrypoints/shared/backup_filename.ts) defining the canonical backup filename format: nufftabs-backup-<ISO-with-dashes>-g<groupCount>.json\n  - Example: nufftabs-backup-2026-02-23T02-20-49-747Z-g22.json\n- Update Drive backup filename creation (entrypoints/drive/types.ts createBackupFileName) to use the shared helper so uploads and local exports converge on the same naming.\n- Keep backward compatibility for listing/group-count extraction by continuing to parse the -g<digits>.json suffix regardless of prefix.\n\nDocs + tests\n- Update Drive backup docs/examples to reflect the new canonical prefix.\n- Add unit tests for the shared helper and update existing Drive utility tests to assert the new prefix.
What\n- Local list-page JSON export download name now matches the canonical backup filename format used by Drive backups: nufftabs-backup-<timestamp>-g<groupCount>.json.\n- The group count is derived from the exported saved-groups object so it remains O(nGroups) and avoids any extra storage reads.\n\nAlso\n- Standardize Import/Export user-facing error messages to a consistent, friendlier style (period-separated sentences instead of mixed colon formats).\n- Add IO-specific error wrapper so unexpected exceptions surface a clear snackbar message, while leaving other list-page actions unchanged.\n\nTests\n- Update integration assertions to match the new standardized OneTab/import-file messages.
TypeScript parsing failed because the updated assertion used escaped quotes (\"...\") instead of a normal string literal. This commit switches to a standard double-quoted string so pnpm compile passes.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @viseshrp, 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 focuses on improving the robustness and user experience of backup and import functionalities. It standardizes backup file naming for better consistency and maintainability, centralizing the logic into a new utility module. Additionally, it significantly enhances user feedback by providing more descriptive and actionable error messages for various import and export scenarios, ensuring a smoother experience for users encountering issues.

Highlights

  • Backup File Naming Standardization: Standardized the naming convention for all NuffTabs backup files, both for local exports and Google Drive backups, by introducing a consistent nufftabs-backup- prefix. This ensures uniformity and better identification of backup files.
  • Refactored Backup Filename Utilities: Extracted backup filename creation and parsing logic into a new shared utility file (entrypoints/shared/backup_filename.ts). This centralizes the logic, making it reusable and easier to maintain across different parts of the application.
  • Improved User-Facing Error Messages: Enhanced the clarity and helpfulness of error messages displayed to users during import and export operations. Messages are now more specific, guiding users on how to resolve common issues.
  • Centralized IO Task Error Handling: Introduced a new runIoTask utility function to consistently handle errors for import/export operations, providing a standardized way to log errors and display user-friendly messages.
Changelog
  • docs/DRIVE_BACKUP_SPEC.md
    • Updated the documented Drive folder layout to reflect the new nufftabs-backup- file naming convention.
  • docs/storage.md
    • Modified the example fileName in the driveBackupIndex to use the new nufftabs-backup- prefix.
  • entrypoints/drive/types.ts
    • Imported createNufftabsBackupFileName and extractTabGroupCountFromBackupFileName from the new shared utility.
    • Refactored createBackupFileName to use createNufftabsBackupFileName.
    • Refactored extractTabGroupCountFromFileName to use extractTabGroupCountFromBackupFileName.
  • entrypoints/nufftabs/index.ts
    • Imported isIgnorableExtensionError and createNufftabsBackupFileName.
    • Added a new runIoTask function for standardized import/export error handling and user messaging.
    • Calculated groupCount in exportJson to be used in the new filename utility.
    • Updated the local export filename generation to use createNufftabsBackupFileName.
    • Revised several setStatus messages for export and import failures to be more user-friendly and informative.
    • Refactored event listeners for export and import actions to utilize the new runIoTask for consistent error handling and messaging.
  • entrypoints/shared/backup_filename.ts
    • Added a new file containing shared utilities for creating and parsing NuffTabs backup filenames.
    • Defined NUFFTABS_BACKUP_FILE_PREFIX for consistent naming.
    • Implemented formatBackupTimestampSegment to create filename-safe ISO timestamps.
    • Implemented createNufftabsBackupFileName to generate standardized backup filenames.
    • Implemented extractTabGroupCountFromBackupFileName to extract group counts from filenames.
  • tests/integration/actions.test.ts
    • Updated assertions for expected error messages in OneTab import and JSON file import tests to match the new, more descriptive messages.
  • tests/unit/backup_filename.test.ts
    • Added new unit tests to verify the functionality of formatBackupTimestampSegment, createNufftabsBackupFileName, and extractTabGroupCountFromBackupFileName.
  • tests/unit/drive_backup_utils.test.ts
    • Updated assertions in tests to expect the new nufftabs-backup- prefix in generated filenames.
Activity
  • No human activity has been recorded on this pull request yet.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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. ↩

@codecov

codecov Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.8%. Comparing base (eb52c12) to head (a52e948).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
entrypoints/shared/backup_filename.ts 93.7% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main     #27     +/-   ##
=======================================
- Coverage   94.9%   94.8%   -0.1%     
=======================================
  Files         17      18      +1     
  Lines       2120    2132     +12     
  Branches     555     556      +1     
=======================================
+ Hits        2012    2023     +11     
- Misses        96      97      +1     
  Partials      12      12             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This is a great pull request that successfully standardizes the backup filename format and improves user-facing error messages for import/export operations. The refactoring of filename logic into a new shared module backup_filename.ts with its own unit tests is a solid improvement for maintainability. The introduction of runIoTask and the more descriptive error messages significantly enhance the user experience. I have one suggestion to make the error handling for JSON imports even more robust.

Comment thread entrypoints/nufftabs/index.ts
@viseshrp
viseshrp merged commit 4abfcf5 into main Feb 24, 2026
5 checks passed
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