Fix issue about complete pgt external#1362
Conversation
Review Summary by QodoFix PgtExternalTask model and API method signature issues
WalkthroughsDescription• Add [FromBody] parameter to CompletePgtExternalAsync method signature • Make CreatedAt and UpdatedAt properties nullable DateTime • Remove ClaimedAt property from PgtExternalTask model • Remove unnecessary JsonIgnore attributes from datetime properties Diagramflowchart LR
A["IMembaseApi Interface"] -->|"Add [FromBody] parameter"| B["CompletePgtExternalAsync"]
C["PgtExternalTask Model"] -->|"Make nullable"| D["CreatedAt/UpdatedAt"]
C -->|"Remove property"| E["ClaimedAt"]
C -->|"Clean up attributes"| F["JsonIgnore removal"]
File Changes1. src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs
|
Code Review by Qodo
1. Wrong body attribute
|
|
reviewed |
|
|
||
| [Post("/graph/{graphId}/pgt-external/{correlationId}/complete")] | ||
| Task<PgtExternalCompleteResponse> CompletePgtExternalAsync(string graphId, string correlationId); | ||
| Task<PgtExternalCompleteResponse> CompletePgtExternalAsync(string graphId, string correlationId, [FromBody] object emptyBody); |
There was a problem hiding this comment.
1. Wrong body attribute 🐞 Bug ≡ Correctness
IMembaseApi.CompletePgtExternalAsync uses ASP.NET Core MVC [FromBody] on a Refit client
interface, so Refit may not serialize/send the request body for this POST call. If
/pgt-external/{correlationId}/complete requires a JSON body (even {}), the call can still fail
at runtime.
Agent Prompt
## Issue description
`CompletePgtExternalAsync` is part of a Refit REST client interface but its new parameter is annotated with ASP.NET Core MVC `[FromBody]`. Refit expects its own `[Body]` attribute for request-body serialization; using `[FromBody]` may result in no body being sent.
## Issue Context
This interface is registered via `AddRefitClient<IMembaseApi>(...)`, and other methods in the same interface consistently use Refit `[Body]` for payloads.
## Fix Focus Areas
- src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs[62-64]
### Suggested fix
- Change `[FromBody] object emptyBody` to `[Body] object emptyBody`.
- (Optional, clearer) Replace `object` with a dedicated empty request type (e.g., `PgtExternalCompleteRequest`) and pass `new PgtExternalCompleteRequest()` (or `new {}`) from call sites.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
No description provided.