eclipse-thingweb / eclipse-thingweb/node-wot
Existing client re-use without credentials set
- Dominant language
- TypeScript
- Stars
- 192
- Forks
- 100
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
Description
I found another unexpected behavior:
If I read a property with a specific `formIndex`
```
const interactionOutput = await thing.readProperty("test", { formIndex: 0 });
```
and if a client already exists I get a client for that protocol without `credentials` set. If no client exists everything works fine.
https://github.com/eclipse/thingweb.node-wot/blob/07494392e1def691f06adeae4224afac7cd4cd65/packages/core/src/consumed-thing.ts#L491
This retrieves the client from servient leading to a client without `credentials`.
https://github.com/eclipse/thingweb.node-wot/blob/07494392e1def691f06adeae4224afac7cd4cd65/packages/core/src/consumed-thing.ts#L493
This instead returns a valid client with `credentials` set.
Should the client always be retrieved with `this.getClients().get(scheme)` like here?
https://github.com/eclipse/thingweb.node-wot/blob/07494392e1def691f06adeae4224afac7cd4cd65/packages/core/src/consumed-thing.ts#L512
_Originally posted by @ilovemilk in https://github.com/eclipse/thingweb.node-wot/issues/890#issuecomment-1339239278_
Contributor guide
Assessment
This issue has not been assessed yet.