Skip to content

fix: avoid persisting invalid plugin upload artifacts - #739

Merged
laipz8200 merged 1 commit into
mainfrom
laipz8200/fix-plugin-upload-validation-cleanup
May 17, 2026
Merged

fix: avoid persisting invalid plugin upload artifacts#739
laipz8200 merged 1 commit into
mainfrom
laipz8200/fix-plugin-upload-validation-cleanup

Conversation

@laipz8200

Copy link
Copy Markdown
Member

Description

Adjust plugin upload validation order so failed validations do not leave stale upload artifacts.
Keep bundle package uploads atomic when dependency validation fails.

Type of Change

  • Bug fix

Additional Information

No additional context.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the plugin package management system by introducing a two-phase "Prepare" and "Persist" workflow, which enables robust rollback capabilities for assets, packages, and database records during upload failures. The changes also include the addition of miniredis and sqlite dependencies to support a new suite of integration tests for plugin and bundle uploads. Review feedback identifies a potential resource leak if the plugin decoder is not closed and points out a race condition in the rollback logic that could lead to data loss during concurrent uploads. Additionally, the reviewer suggests removing redundant identity checks in the service layer to simplify the code.

Comment thread internal/core/plugin_manager/packages.go
Comment thread internal/core/plugin_manager/packages.go
Comment thread internal/service/plugin_decoder.go Outdated
Comment thread internal/service/plugin_decoder.go Outdated
@laipz8200
laipz8200 force-pushed the laipz8200/fix-plugin-upload-validation-cleanup branch from 5d4fca3 to 936a6cc Compare May 16, 2026 15:07
@laipz8200
laipz8200 force-pushed the laipz8200/fix-plugin-upload-validation-cleanup branch from 936a6cc to d248c12 Compare May 16, 2026 15:15
@laipz8200
laipz8200 marked this pull request as ready for review May 16, 2026 15:32
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working go Pull requests that update go code plugin-daemon labels May 16, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 17, 2026
@laipz8200
laipz8200 merged commit e4ba226 into main May 17, 2026
7 checks passed
@laipz8200
laipz8200 deleted the laipz8200/fix-plugin-upload-validation-cleanup branch May 17, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code lgtm This PR has been approved by a maintainer plugin-daemon size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants