Commit ccbddd7
committed
fix(updates): drop redundant id guard in register seed path + CHANGELOG
Callers of UpdateManager::register_update (update_handlers.cpp:108)
already validate that metadata["id"] is a non-empty string before
invoking the manager, so the outer `if (metadata.contains("id") &&
metadata["id"].is_string())` check wrapping the seed block could never
hit its else branch with any in-tree caller. Replace it with a direct
metadata.at("id").get<std::string>() so the precondition is expressed
explicitly and .at() would throw clearly if the contract were ever
broken. The inner `!state_ptr` idempotency check is kept, matching the
pattern in start_prepare / run_prepare.
Add a CHANGELOG.rst entry under Unreleased documenting the observable
contract change: GET /api/v1/updates/{id}/status returns 200 pending
immediately after POST /api/v1/updates, whereas previously 404 was
returned for registered-but-idle packages. 404 is now reserved for
packages that are not registered.1 parent c17eed6 commit ccbddd7
2 files changed
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
| |||
0 commit comments