Commit ef653e7
authored
refactor(query): Gracefully handle unknown GrantEntry objects in UserGrantSet::from_pb (#18400)
* fix(query): Gracefully handle unknown GrantEntry objects in UserGrantSet::from_pb
When an older version of the application processes `UserGrantSet` data that
contains `GrantEntry` objects with newly introduced `GrantObject` types, the
`GrantEntry::from_pb` conversion can fail for those specific entries.
This commit modifies the `UserGrantSet::from_pb` function to gracefully
handle such scenarios. If `GrantEntry::from_pb` returns an error (e.g.,
due to an unknown `GrantObject`), the error is now logged, and the
problematic grant entry is skipped instead of causing the entire
conversion to fail.
This ensures that users on older versions can still log in and use
their available grants, providing better forward compatibility and
robustness against evolving data schemas.
Without this, a user attempting to log in with data containing new
`GrantObject` types would be prevented from logging in on an older client.
* make err msg more detial1 parent f1f6b5b commit ef653e7
File tree
3 files changed
+10
-2
lines changed- src/meta/proto-conv
- src
3 files changed
+10
-2
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
299 | 305 | | |
300 | 306 | | |
301 | 307 | | |
| |||
0 commit comments