Skip to content

Fix error suppression during native_db scans - #133

Open
insign wants to merge 1 commit into
mainfrom
fix-db-operations-error-swallowing-13857551096621645205
Open

Fix error suppression during native_db scans#133
insign wants to merge 1 commit into
mainfrom
fix-db-operations-error-swallowing-13857551096621645205

Conversation

@insign

@insign insign commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Melhoria escolhida: Correção de erro silencioso em operações do banco de dados (Confiabilidade / Correção de bug)

Por que agrega valor real ao projeto: A utilização de .filter_map(|p| p.ok()) ignorava silenciosamente erros de desserialização ou corrupção no banco de dados local. Isso faria com que os pacotes simplesmente desaparecessem sem aviso caso houvesse algum problema, escondendo falhas críticas no native_db. Ao alterar para coletar um Result e utilizar ? (como .collect::<std::result::Result<Vec<_>, _>>()?), os erros são propagados corretamente, impedindo a perda silenciosa de dados e avisando o usuário sobre possíveis falhas.

Arquivos alterados:

  • crates/xpm-core/src/db/operations.rs: Substituído todas as ocorrências de .filter_map(|p| p.ok()) por coleções corretas de resultados.

Atualização em .md: Nenhuma, pois a mudança é de comportamento interno no tratamento de erros do banco e a documentação não foi invalidada.

Impacto nos testes: Todos os testes foram mantidos e executados via cargo test, continuando a passar sem alterações.

Observações: Nenhuma dependência foi adicionada ou modificada e todas as restrições sobre evitar arquivos temporários foram atendidas (arquivos auxiliares foram removidos e o log de git status comprova limpeza).


PR created automatically by Jules for task 13857551096621645205 started by @insign

This change replaces `.filter_map(|p| p.ok())` with `.collect::<Result<Vec<_>, _>>()?` and propagating it upwards when retrieving packages and settings. This ensures that any data corruption or deserialization errors correctly bubble up rather than silently vanishing, greatly enhancing system reliability.

Co-authored-by: insign <1113045+insign@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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