Skip to content

fix: clear dismissal flags when manually checking for updates#147

Merged
AnthonyRonning merged 1 commit intomasterfrom
claude/issue-146-20250715_023716
Jul 15, 2025
Merged

fix: clear dismissal flags when manually checking for updates#147
AnthonyRonning merged 1 commit intomasterfrom
claude/issue-146-20250715_023716

Conversation

@AnthonyRonning
Copy link
Contributor

@AnthonyRonning AnthonyRonning commented Jul 15, 2025

Fixes #146

When users click "Check for Updates" in the menu, clear the UPDATE_DOWNLOADED flag and CURRENT_VERSION to ensure they always get prompted for available updates, even if they previously dismissed the update notification.

This fixes the issue where manually clicking "Check for Updates" would not show the update prompt after a user had previously dismissed it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Reset update dismissal flags when manually checking for updates, ensuring users are prompted again for available updates.

When users click "Check for Updates" in the menu, clear the UPDATE_DOWNLOADED
flag and CURRENT_VERSION to ensure they always get prompted for available
updates, even if they previously dismissed the update notification.

This fixes the issue where manually clicking "Check for Updates" would not
show the update prompt after a user had previously dismissed it.

Co-authored-by: Anthony <AnthonyRonning@users.noreply.github.com>
@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

Walkthrough

The event handler for the "Check for Updates" menu action in the Tauri frontend was updated to clear any previously set update dismissal flags before initiating an update check. This ensures that update prompts will always display, even if previously dismissed. Additional logging was added to indicate when these flags are cleared.

Changes

File(s) Change Summary
frontend/src-tauri/src/lib.rs Modified update check handler to clear update dismissal flags and log this action before checking for updates.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant UpdateChecker

    User->>App: Clicks "Check for Updates"
    App->>App: Clear UPDATE_DOWNLOADED flag
    App->>App: Clear CURRENT_VERSION string
    App->>UpdateChecker: Initiate update check
    UpdateChecker-->>App: Returns update status
    App-->>User: Display update prompt if available
Loading

Assessment against linked issues

Objective Addressed Explanation
Always check for updates and display prompt when "Check for Updates" is clicked (#146)

Poem

A rabbit hops and clears the way,
For updates fresh, no flags to sway.
Click "Check for Updates"—never miss,
The prompt returns, no more abyss!
With logs that show the path anew,
Your updates now will follow through.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Clippy (1.86.0)
Updating crates.io index

warning: failed to write cache, path: /usr/local/registry/index/index.crates.io-1949cf8c6b5b557f/.cache/3/l/log, error: Permission denied (os error 13)
Downloading crates ...
Downloaded alloc-stdlib v0.2.2
error: failed to create directory /usr/local/registry/cache/index.crates.io-1949cf8c6b5b557f

Caused by:
Permission denied (os error 13)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62b9efd and 8f97be6.

📒 Files selected for processing (1)
  • frontend/src-tauri/src/lib.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: AnthonyRonning
PR: OpenSecretCloud/Maple#23
File: frontend/src-tauri/src/lib.rs:14-16
Timestamp: 2025-03-25T19:50:07.925Z
Learning: In Tauri applications, the updater configuration (including security settings like server URL and public key) should be defined in tauri.conf.json rather than hardcoded in the application code. The code only needs to initialize the updater plugin with tauri_plugin_updater::Builder::new().build(), which will automatically use the settings from the configuration file.
Learnt from: AnthonyRonning
PR: OpenSecretCloud/Maple#23
File: frontend/src-tauri/src/lib.rs:14-16
Timestamp: 2025-03-25T19:50:07.925Z
Learning: In Tauri applications, updater security configurations (including endpoints, public key for verification, and dialog settings) should be defined in the tauri.conf.json file rather than duplicated in the code. When initialized with tauri_plugin_updater::Builder::new().build(), the plugin automatically reads and uses these settings from the configuration file.
frontend/src-tauri/src/lib.rs (1)
Learnt from: AnthonyRonning
PR: OpenSecretCloud/Maple#136
File: frontend/src-tauri/tauri.conf.json:4-4
Timestamp: 2025-07-02T22:53:39.374Z
Learning: When reviewing version bump PRs, version numbers found in Cargo.lock files are typically dependency versions (like aho-corasick), not the application version. Don't suggest updating these unless they are specifically the application's own version entry.
🔇 Additional comments (3)
frontend/src-tauri/src/lib.rs (3)

165-165: Enhanced logging message improves debugging clarity.

The updated log message clearly indicates the dual purpose of clearing dismissal flags and triggering the update check, which will be helpful for debugging user-reported issues.


168-177: Proper implementation of dismissal flag clearing.

The code correctly clears both dismissal flags using appropriate thread-safe operations:

  • UPDATE_DOWNLOADED.store(false, Ordering::SeqCst) - Uses sequentially consistent ordering for the atomic boolean
  • CURRENT_VERSION.lock() with proper error handling for the mutex-protected string

The error handling for the mutex lock is appropriate - it logs failures but doesn't abort the operation, since clearing the version string is not critical enough to prevent the update check from proceeding.

This implementation ensures users will always be prompted for available updates when manually triggering the check, which directly addresses the issue described in the PR objectives.


177-177: Confirmation logging enhances user experience.

The additional log message provides clear confirmation that the dismissal flags have been cleared, making it easier to verify the fix is working as expected during testing and debugging.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements a user experience improvement for the update checking functionality in the desktop application. When a user manually triggers 'Check for Updates' from the menu, the code now clears two internal flags (UPDATE_DOWNLOADED and CURRENT_VERSION) that were previously preventing update notifications from appearing if a user had dismissed them.

The change consists of adding a clear mechanism in the update check event handler that:

  1. Sets UPDATE_DOWNLOADED atomic boolean to false
  2. Clears the CURRENT_VERSION mutex-protected value

This modification ensures that manual update checks always show available updates to users, while preserving the existing behavior for automatic checks to prevent notification spam.

Confidence score: 4/5

  1. This PR is safe to merge with minimal risk of adverse effects
  2. The changes are focused, well-documented, and only affect user-initiated update checks without modifying the core update logic
  3. The mutex locking logic in CURRENT_VERSION.lock() should be reviewed carefully for potential deadlock scenarios

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@AnthonyRonning AnthonyRonning merged commit 5e010cb into master Jul 15, 2025
7 checks passed
@AnthonyRonning AnthonyRonning deleted the claude/issue-146-20250715_023716 branch July 15, 2025 03:50
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.

Check for Updates should always check

1 participant