update all rust dependencies#126
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Summary by QodoUpgrade Rust workspace dependencies and migrate to newer Actix/SQLx/Base64 APIs
AI Description
Diagram
High-Level Assessment
Files changed (48)
|
Code Review by Qodo
1. Multipart error chain lost
|
| Err(err) => return Err(anyhow::anyhow!("{err}")), | ||
| }; | ||
|
|
||
| let content_disposition = field.content_disposition(); | ||
| let content_disposition = field.content_disposition().ok_or_else(|| err!(BAD_REQUEST, "No content disposition header"))?; | ||
| let file_name = content_disposition.get_filename().ok_or_else(|| err!(BAD_REQUEST, "No file name"))?; | ||
| let extension = file_name | ||
| .rsplit_once('.') |
There was a problem hiding this comment.
1. Multipart error chain lost 🐞 Bug ◔ Observability
put_avatar now turns multipart read errors into formatted strings (anyhow!("{err}") /
anyhow!("{e}")), which discards the original error type/source chain and makes failures harder to
debug.
Agent Prompt
### Issue description
`put_avatar` currently stringifies multipart errors into a fresh `anyhow` error, which drops the original error as the source (no chained causes). This reduces diagnostic value in logs/error rendering.
### Issue Context
This regression was introduced during the dependency update (actix-multipart API changes). The handler previously preserved the underlying error via conversion.
### Fix Focus Areas
- gitarena/src/routes/user/avatar.rs[85-103]
### Suggested fix
- Replace `return Err(anyhow::anyhow!("{err}"))` with `return Err(err.into())` **or** `return Err(anyhow::Error::new(err))`.
- Replace `.map_err(|e| anyhow::anyhow!("{e}"))?` with `.map_err(anyhow::Error::new)?` or `.context("Failed to read multipart data chunk")?` to keep the source chain while adding context.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
No description provided.