Commit 2fcff3c
committed
Extract timestamp as double for InMemorySessionService events
InMemorySessionService sets a Session's last modified time based on when
the last appended event's timestamp. The timestamp in an event is
recorded in millis while the Session's timestamp is an Instant. During
the transformation, Events perform this converstion using division.
Before this change, the timestamp was truncated to the second, yet the
code was trying to extract nanos which were always 0. This fixes that
bug with a simple type change. I've also added a test to prevent
regressions.1 parent 8556d4a commit 2fcff3c
2 files changed
Lines changed: 21 additions & 11 deletions
File tree
- core/src
- main/java/com/google/adk/sessions
- test/java/com/google/adk/sessions
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
| 157 | + | |
159 | 158 | | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 164 | | |
171 | 165 | | |
172 | 166 | | |
| |||
294 | 288 | | |
295 | 289 | | |
296 | 290 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 291 | + | |
301 | 292 | | |
302 | 293 | | |
303 | 294 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
217 | 236 | | |
218 | 237 | | |
219 | 238 | | |
| |||
0 commit comments