I’m having some trouble getting temporal to play nice with golang mongo.WriteModels.
I have an activity it’s just a mongo.BulkWrite
// Activity
func (a *Activity) ActivityBulkDeleteManyTest(ctx context. Context, collectionName string, writeModels []mongo.WriteModel) (*mongo.BulkWriteResult, error) {
return a.db.Collection(collectionName).BulkWrite(
ctx,
writeModels,
)
}
// From WorkflowTest
val, err := env.ExecuteActivity(a.ActivityBulkDeleteManyTest, "collectionName", writeModels)
require.NoError(t, err)
The problem I’m facing is from the env.ExecuteActivity that require NoError returns the following error
unable to decode the activity function input payload with error: payload item 1:
unable to decode: json: cannot unmarshal object into Go value of type mongo.WriteModel for function name: ActivityBulkDeleteManyTest (type: wrapError, retryable: true):
payload item 1: unable to decode: json: cannot unmarshal object into Go value of type mongo.WriteModel (type: wrapError, retryable: true): unable to decode: json: cannot unmarshal object into Go value of type mongo.WriteModel (type: wrapError, retryable: true): unable to decode
I’ve tried implementing a custom data converter without avail one I grabbed from the pso example and tweaked to look at mongo.WriteModels