Commit 8e222fa
authored
improvement(polling): fix correctness and efficiency across all polling handlers (#4067)
* improvement(polling): fix correctness and efficiency across all polling handlers
- Gmail: paginate history API, add historyTypes filter, differentiate 403/429,
fetch fresh historyId on fallback to break 404 retry loop
- Outlook: follow @odata.nextLink pagination, use fetchWithRetry for all Graph
calls, fix $top alignment, skip folder filter on partial resolution failure,
remove Content-Type from GET requests
- RSS: add conditional GET (ETag/If-None-Match), raise GUID cap to 500, fix 304
ETag capture per RFC 9111, align GUID tracking with idempotency fallback key
- IMAP: single connection reuse, UIDVALIDITY tracking per mailbox, advance UID
only on successful fetch, fix messageFlagsAdd range type, remove cross-mailbox
legacy UID fallback
- Dispatch polling via trigger.dev task with per-provider concurrency key;
fall back to synchronous Redis-locked polling for self-hosted
* fix(rss): align idempotency key GUID fallback with tracking/filter guard
* removed comments
* fix(imap): clear stale UID when UIDVALIDITY changes during state merge
* fix(rss): skip items with no identifiable GUID to avoid idempotency key collisions
* fix(schedules): convert dynamic import of getWorkflowById to static import
* fix(imap): preserve fresh UID after UIDVALIDITY reset in state merge
* improvement(polling): remove trigger.dev dispatch, use synchronous Redis-locked polling
* fix(polling): decouple outlook page size from total email cap so pagination works1 parent b67c068 commit 8e222fa
6 files changed
+441
-277
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| |||
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 74 | | |
73 | 75 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
155 | 156 | | |
156 | | - | |
157 | | - | |
158 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
171 | 181 | | |
172 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
173 | 195 | | |
174 | | - | |
175 | | - | |
176 | | - | |
| 196 | + | |
177 | 197 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
181 | 201 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
187 | 209 | | |
188 | 210 | | |
189 | | - | |
190 | 211 | | |
191 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
192 | 216 | | |
193 | 217 | | |
194 | 218 | | |
| |||
352 | 376 | | |
353 | 377 | | |
354 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
355 | 402 | | |
356 | 403 | | |
357 | 404 | | |
| |||
442 | 489 | | |
443 | 490 | | |
444 | 491 | | |
445 | | - | |
446 | | - | |
447 | | - | |
| 492 | + | |
448 | 493 | | |
449 | 494 | | |
450 | 495 | | |
| |||
0 commit comments