Commit 658a727
committed
Fix tedge-agent panic on entity registration
Mixing entity registrations over MQTT and HTTP:
```
tedge mqtt pub te/device/a/service/c '{"@parent":"device/a//","@type":"service"}'
tedge mqtt pub te/device/ac// '{"@parent":"device/a//","@type":"child-device"}'
curl http://localhost:8000/tedge/entity-store/v1/entities -v -H "Content-Type: application/json" -d '{"@topic-id": "device/a/service/c", "@type": "service", "@parent": "device/a//"}'
curl http://localhost:8000/tedge/entity-store/v1/entities -v -H "Content-Type: application/json" -d '{"@topic-id": "device/a//", "@type": "child-device", "@parent": "device/main//"}'
```
was crashing the agent:
```
thread 'tokio-runtime-worker' panicked at crates/core/tedge_api/src/store/pending_entity_store.rs:96:73:
called `Option::unwrap()` on a `None` value
```
Signed-off-by: Didier Wenzek <[email protected]>1 parent 62a8f4d commit 658a727
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
0 commit comments