Skip to content

fix(fs): scope ThreadRng to ensure future is Send in save_asset#91

Merged
VariableThe merged 3 commits into
mainfrom
fix/save-asset-send
Jul 1, 2026
Merged

fix(fs): scope ThreadRng to ensure future is Send in save_asset#91
VariableThe merged 3 commits into
mainfrom
fix/save-asset-send

Conversation

@VariableThe

Copy link
Copy Markdown
Owner

Summary

Fixes a future cannot be sent between threads safely compilation error in save_asset caused by rand::thread_rng() (which contains Rc<UnsafeCell<...>> and is not Send) being held across an .await point.

Changes

  • src-tauri/src/commands/fs.rs: Scoped rand::thread_rng() inside a block so the ThreadRng is dropped before tokio::fs::write().await, making the future Send.
  • Removed memo-adjacent SHORTCUT_VOICE_MEMO key from settingsKeys.ts.

Background

This branch (from main) cherry-picks the image/asset support commits from feature/v0.5.9-image-support (save_asset, read_asset, image paste widget, etc.) and applies the Send fix on top. No memo/voice files are included.

Closes the future: Send build error.

VariableThe and others added 2 commits July 1, 2026 20:17
Fixed 5 file(s) based on 5 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The head commit changed during the review from 79ca882 to e6737a9.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/save-asset-send

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VariableThe VariableThe merged commit b9a2973 into main Jul 1, 2026
4 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