APP_LOGGER_LEVEL="debug" APP_LOGGER_DEV_MODE=true APP_SUPPORTED_PROVIDERS="dotenv" go run ./cmd/secret-storage-backend/main.go
Run Local Hub:
cd hub-js; APP_NEO4J_ENDPOINT=bolt://localhost:7687 APP_NEO4J_PASSWORD=okon APP_HUB_MODE=local npm run dev; cd ..
Check that no data is stored: ls /tmp/capact
Run test:
GRPC_SECRET_STORAGE_BACKEND_ADDR="0.0.0.0:50051" go test ./pkg/hub/client/local/ -v -count 1
You should output that describe Local Hub state after each operation.
Check that no data is stored: ls /tmp/capactas the above test also cleans up all created TypeInstances and gRPC call is also executed against external backends.
I'm not sure how this can happen, as it's not possible via exposed API. Probably there is some "race" directly in used library with Put implementation. However, we decided that backends don't need to be thread safe. To resolve that issue I used the mutex lib to prevent concurrent execution of value field resolver.
Description
Changes proposed in this pull request:
backend.context
fieldNew scope:
Testing
The test that I wrote, proves that it works e2e (Go client -> GraphQL -> Local Hub -> External Storage).
Run neo4j:
Run modified storage server:
Run Local Hub:
Check that no data is stored:
ls /tmp/capact
Run test:
You should output that describe Local Hub state after each operation.
Check that no data is stored:
ls /tmp/capact
as the above test also cleans up all created TypeInstances and gRPC call is also executed against external backends.Related issue(s)
Notes
Sometimes I got unpredictable result from
dotenv
:and in file:
I'm not sure how this can happen, as it's not possible via exposed API. Probably there is some "race" directly in used library with
Put
implementation. However, we decided that backends don't need to be thread safe. To resolve that issue I used the mutex lib to prevent concurrent execution ofvalue
field resolver.