• Steven's avatar
    fix(backend): correct generic type parameter in withHeaderCarrier helper · 65a19df4
    Steven authored
    Problem:
    The withHeaderCarrier generic function had a type mismatch that caused compilation
    errors in CI. The function used `T proto.Message` constraint, but Connect's Response
    type expects the non-pointer message type while protobuf methods return pointers.
    
    Error from CI:
      type T of resp does not match *T (cannot infer T)
    
    This occurred because:
    - Connect methods expect: *connect.Response[v1pb.CreateSessionResponse]
    - Service methods return: (*v1pb.CreateSessionResponse, error)
    - Old signature: fn func(context.Context) (T, error) with T proto.Message
    - This caused T to be inferred as *v1pb.CreateSessionResponse
    - Leading to return type: *connect.Response[*v1pb.CreateSessionResponse] (wrong!)
    
    Solution:
    Changed generic signature to explicitly handle the pointer/non-pointer distinction:
    - New signature: fn func(context.Context) (*T, error) with T any
    - T is now the non-pointer type (e.g., v1pb.CreateSessionResponse)
    - fn returns *T (e.g., *v1pb.CreateSessionResponse)
    - Return type is correctly: *connect.Response[T] (e.g., *connect.Response[v1pb.CreateSessionResponse])
    
    Also removed unused "google.golang.org/protobuf/proto" import and improved documentation
    to clarify the T vs *T distinction.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    Co-Authored-By: 's avatarClaude Sonnet 4.5 <noreply@anthropic.com>
    65a19df4
Name
Last commit
Last update
..
auth Loading commit data...
router Loading commit data...
runner Loading commit data...
server.go Loading commit data...