#Function Caching + Interfaces Possible Bug
1 messages · Page 1 of 1 (latest)
Hi there guys. I may have found a bug when using function caching with interfaces (specifically when using module constructors). I have been testing on 0.19.6.
I have the following drive module which accepts a car as an interface:
package main
import "context"
type Drive struct {
Car Car
}
func New(car Car) *Drive {
return &Drive{Car: car}
}
func (d *Drive) DriveIt(ctx context.Context) error {
return d.Car.Drive(ctx)
}
type Car interface {
DaggerObject
Drive(ctx context.Context) error
}
When invoking driveit 2 times in a row, I end up with a weird error message the second time:
! collect IDs: failed to convert field "Car": load interface implementation: schema: load source mod: load asModule: load: load base: load base: local
path "/Users/christopher.palmer/workspace/library-ci-workflows/function-caching-test/drive" does not exist
Given this repo: https://github.com/chrisjpalmer/function-caching-test/tree/master
If you run:
dagger call drive-rolls-royce
dagger call drive-rolls-royce
I get the following error on the second run:
! collect IDs: failed to convert field "Car": load interface implementation: schema: load source mod: load asModule: load: load base: load base: local
path "/Users/christopher.palmer/workspace/library-ci-workflows/function-caching-test/drive" does not exist
The problem goes away if I add // +cache="never" to the constructor here
Function Caching + Interfaces Possible Bug
Can confirm this is happening on 1.19.4 as well