Commit c1f68c7
authored
Fix refresh token behavior on EXPIRY_MARGIN (#122)
The previous behavior was resulting in the library using an expired
token for a few minutes (for as long as EXPIRY_MARGIN_IN_MINUTES to be
precise), and that is because we had the following timeline:
- now-5min = 2022-12-23T09:57:00Z
- now = 2022-12-23T10:02:00Z
- expiresAt = 2022-12-23T10:05:00Z
- now+5min = 2022-12-23T10:07:00Z
So checking if expiresAt is before now-5min returns true until
now = 2022-12-23T10:09:59Z, which means the calls will fail without the
token being refreshed until that point.1 parent d8ac35a commit c1f68c7
File tree
2 files changed
+28
-2
lines changed- src
- main/java/com/spotify/github/v3/clients
- test/java/com/spotify/github/v3/clients
2 files changed
+28
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
704 | | - | |
705 | | - | |
| 704 | + | |
| 705 | + | |
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| |||
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
152 | 178 | | |
153 | 179 | | |
154 | 180 | | |
| |||
0 commit comments