Commit b03997a
committed
fix(client): reject at_timestamp=0 instead of silently unpinning the read
at_timestamp is a plain proto3 scalar with no field presence, so zero is
not serialised and the server reads the field as absent. A caller asking
to read as of the epoch therefore got a current read: the request was
accepted, the pin was dropped on the wire, and live data came back for a
time-travel query. The same package already asserts that half of it, in
test_absent_by_default, which pins an unpinned request to timestamp zero.
Validation now requires a positive integer and says why, and the public
docstring records that zero is how the wire says "no pin" and so cannot
also ask for one.
Carries a regression test for the zero case; it fails against the previous
validation, which accepted anything non-negative.1 parent 501d338 commit b03997a
2 files changed
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| |||
1116 | 1117 | | |
1117 | 1118 | | |
1118 | 1119 | | |
1119 | | - | |
1120 | | - | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1121 | 1128 | | |
1122 | 1129 | | |
1123 | 1130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
| |||
0 commit comments