Skip to content

refactor(connectivity): private_link returns Value, should return TaskStateUpdate (14 methods + VPC/TGW deletes) #78

@joshrotenberg

Description

@joshrotenberg

Summary

The entire private_link module returns Result<serde_json::Value> on 14 methods where the spec promises TaskStateUpdate. Additionally, vpc_peering and transit_gateway deletes return Value::Null (response body discarded) when the spec returns a Task. Cuts callers off from polling the resulting async operation.

Expected behavior

Every connectivity endpoint that the spec marks as task-returning (i.e. has a taskId in the response) should return the canonical TaskStateUpdate so callers can poll /tasks/{taskId} to completion.

Actual behavior

  • src/connectivity/private_link.rs:325-625 — 14 typed methods (get_private_link, create_private_link, delete_private_link, update_private_link, add_principal, remove_principal, get_endpoint_script, disassociate_connections, plus the active-active variants and PSC service variants) all return Result<Value>.
  • src/connectivity/transit_gateway.rs:189,325 — TGW deletes return Result<Value> and discard the body (Value::Null).
  • src/connectivity/vpc_peering.rs — VPC peering deletes have the same shape.

The spec lists TaskStateUpdate as the response on each of these.

Impact

Callers cannot use the typed handlers to track async operations on connectivity. They must drop to client.get_raw("/tasks/{id}") themselves and reconstruct the polling loop. Inconsistent with the rest of the crate, which already returns TaskStateUpdate for similar mutating operations on databases/subscriptions.

Relevant code

  • src/connectivity/private_link.rs:325-625 (14 methods)
  • src/connectivity/transit_gateway.rs:189,325
  • src/connectivity/vpc_peering.rs (delete handlers)

Suggested fix

Change the return type from Result<Value> to Result<TaskStateUpdate> (using the canonical type from #64). For deletes, send the delete_with_body request and deserialize the response.

This is best done after — or as part of — #64 so we don't migrate Value→Value-typed-as-TaskStateUpdate→canonical-TaskStateUpdate in two passes.

Acceptance criteria

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions