TT 7348 desktop save - #554
Merged
Merged
Conversation
gtryus
commented
Aug 28, 2026
Contributor
- Introduced new tests for the writeFileLocal function to validate disk write operations, including successful writes and error handling for write failures.
- Enhanced nextUpload action to ensure it gracefully handles local disk write errors, dispatching appropriate failure actions and preventing cloud uploads when local saves fail.
- Updated the actions module to use async/await for improved readability and error handling in the nextUpload function.
- Mocked IPC methods for testing to simulate file operations without actual disk access.
… module - Introduced new tests for the writeFileLocal function to validate disk write operations, including successful writes and error handling for write failures. - Enhanced nextUpload action to ensure it gracefully handles local disk write errors, dispatching appropriate failure actions and preventing cloud uploads when local saves fail. - Updated the actions module to use async/await for improved readability and error handling in the nextUpload function. - Mocked IPC methods for testing to simulate file operations without actual disk access.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens the desktop upload workflow by ensuring local media saves are correctly awaited and that local staging/write failures are handled without proceeding to cloud upload. It also adds focused tests around local disk write behavior via mocked Electron IPC.
Changes:
- Ensure
writeFileLocalawaits the IPCwritecall so in-memory recordings aren’t treated as saved before the disk write completes. - Improve offline/local-save flow in
nextUploadto properly catch and report local write failures. - Add Jest coverage for successful local writes and failure cases (including aborting cloud upload when local save fails).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/renderer/src/store/upload/actions.tsx |
Awaits IPC disk writes and tightens async error handling around offline/local save behavior. |
src/renderer/src/store/upload/actions.pendingRetry.test.ts |
Adds tests validating disk-write success/failure and that cloud POST is skipped when local staging fails. |
Suppressed comments (1)
src/renderer/src/store/upload/actions.pendingRetry.test.ts:504
- Avoid using a fixed
setTimeoutdelay to wait for async work; it makes the test slower and can be flaky on slow CI. SincenextUploadschedules work via promises, flushing microtasks is enough to let the failure dispatch run.
action(dispatch);
await new Promise((resolve) => setTimeout(resolve, 20));
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
gtryus
marked this pull request as ready for review
August 28, 2026 19:28
sarahentzel
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.